File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Changing Font Size on a Chart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Changing Font Size on a Chart" Watch "Changing Font Size on a Chart" New topic
Author

Changing Font Size on a Chart

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
I am using JFreeCharts and tring to change the font size that is used to display bar values.

I am stuck on the line of code showing "WHAT GOES HERE?".

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39543
    
  27
According to the org.jfree.chart.renderer.AbstractRenderer, a java.awt.Font object - which can be constructed with a font name, a font style (like bold, italic, underline etc.) and a font size.


Ping & DNS - updated with new look and Ping home screen widget
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Ulf Dittmer wrote:According to the org.jfree.chart.renderer.AbstractRenderer, a java.awt.Font object - which can be constructed with a font name, a font style (like bold, italic, underline etc.) and a font size.


Still having trouble getting syntax right. Can you help with the correct way to construct the Font?

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39543
    
  27
I'm not familiar with Font.getFont, but the parameters look about right. I'd use a constructor instead: new Font("TimesRoman", Font.PLAIN, 8)

You can call Font.getAllFonts to get a list of all fonts and their correct spellings.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing Font Size on a Chart
 
Similar Threads
Need help in pointing 2 Y values for a single date(X-axis) in JFreeChart
MultiDimenaional Array sort
Display Bar Values in Chart
jasper reports with subreports
Can Someone Explain the Field Value of ItemLabelAnchor