Values on the chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Sruti

Values on the chart

Post by Sruti » Thu Jan 30, 2003 7:02 am

Hi

I have to diasplay the series lables on the x axis below the bars. is this possible? I have given my code below:

In the code below, it is supposed to show two bars for the years 2002 and 2001. I want these to be displayed below the 3D bars. Is this possible

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {


OutputStream out = response.getOutputStream();
String year = request.getParameter("year");
String client = request.getParameter("client");
String type = request.getParameter("type");
DefaultCategoryDataset dataset = getData(year,client,type);
String title = "Comparison Report for " + client; // + title;

JFreeChart chart = ChartFactory.createVerticalBarChart3D(
title,
"",
"Total Calls",
dataset,
true
);

chart.setBackgroundPaint(Color.white);
Plot newPlot = chart.getPlot();
Paint[] myPaint = new Paint[] { new Color(130,0,121),new Color(0,108,130),new Color(127,130,0) };
newPlot.setSeriesPaint(myPaint);
response.setContentType("image/jpeg");
ChartUtilities.writeChartAsPNG(out, chart, 500, 400);

}



When I use

CategoryPlot categoryPlot = chart.getCategoryPlot();
categoryPlot.setValueLabelsVisible(true);

it throws an exception - java.lang.NoSuchMethodError: com.jrefinery.chart.CategoryPlot.setValueLabelsVisible(Z)V



Thanks

Sruti

David Gilbert

Re: Values on the chart

Post by David Gilbert » Thu Jan 30, 2003 9:32 pm

Are you using 0.9.4 or an earlier version?

Regards,

Dave Gilbert

Sruti

Re: Values on the chart

Post by Sruti » Thu Jan 30, 2003 11:20 pm

Hi,

I am using the latest - 0.9.4 version.

Thanks.

Sruti

Sruti

Re: Values on the chart

Post by Sruti » Sun Feb 02, 2003 11:53 am

Hi David

Can you pls have a look at this and let me know whether what I asked in my original post can be done ?

I would really appreciate your response.

Thank you
Sruti

Locked