Dear experts,
Please show me how to highlight the item label in bar chart so it easier to read.
Thanks.
How to highlight the item label
-
- Posts: 13
- Joined: Thu May 18, 2006 6:01 pm
- Location: Washington DC
Highlight a label? I think the best way to do that would be to change the Font and/or Color associated with the label. You should be able to do something like this:
chart is the JFreeChart object.
Good Luck,
Chris
Code: Select all
XYPlot plot = (XYPlot) chart.getPlot();
plot.getDomainAxis().setTickLabelPaint(Color.white);
plot.getDomainAxis().setTickLabelFont(new Font("TimesRoman", Font.BOLD, 12));
plot.getDomainAxis().setLabelPaint(Color.white);
plot.getDomainAxis().setLabelFont(new Font("TimesRoman", Font.BOLD, 12));
Good Luck,
Chris
-
- Posts: 13
- Joined: Thu May 18, 2006 6:01 pm
- Location: Washington DC
I forgot to mention you can also pull the range info with
Code: Select all
plot.getRangeAxis()