Range Label bug?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jfreeuser2006
Posts: 59
Joined: Mon Nov 20, 2006 1:00 pm

Range Label bug?

Post by jfreeuser2006 » Wed Apr 25, 2007 8:04 am

Anybody,

I've upgraded to 1.0.5

I noticed that my range label disappeared. Even though I set it using

Code: Select all


JFreeChart chart = ChartFactory.createLineChart(title, "Date", rangeLabel, null, PlotOrientation.VERTICAL, false, true, false);
I also tried this:

Code: Select all

       
CategoryPlot plot = (CategoryPlot) chart.getPlot();
       
plot.getRangeAxis().setLabel(rangeLabel); 

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Apr 25, 2007 8:07 am

Can you post a small sample app that reproduces this problem? I haven't seen anything similar.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jfreeuser2006
Posts: 59
Joined: Mon Nov 20, 2006 1:00 pm

Post by jfreeuser2006 » Wed May 02, 2007 8:51 am

It was a silly error on my code. I've managed to fix the range labels.

What I did before was set the range labels as i call

Code: Select all

JFreeChart chart = ChartFactory.createLineChart(title, "Date", rangeLabel, dataset, PlotOrientation.VERTICAL, false, true, false);
However later in the code I do a

Code: Select all

NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
which negates or sets my rangeLabel to null. So what I did was

Code: Select all

JFreeChart chart = ChartFactory.createLineChart(title, "Date", null, dataset, PlotOrientation.VERTICAL, false, true, false);
       .
       .
       .
       .
       .
       .
       .
       .
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setLabel(rangeLabel);

Locked