Problem while plotting graph with createDataset

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Narita
Posts: 4
Joined: Fri Sep 05, 2008 1:44 pm

Problem while plotting graph with createDataset

Post by Narita » Mon Sep 08, 2008 7:09 am

Hi All...

I had used Line Chart for creating a chart and had used the following line to create the dataset for the chart.

lDataset.addValue(new Double(lValues), aProjectsListArray, lWeekLabels);

Problem:
When lWeekLabels ( the last argument )array has only 1 element, the Line/the chart does not get plotted. But the lValues is plotted correctly ie the Y axis.

Can somebody provide some help urgently?

Regards,
Narita



skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Mon Sep 08, 2008 1:00 pm

Surely you need more than one datapoint in order to plot a line

Narita
Posts: 4
Joined: Fri Sep 05, 2008 1:44 pm

Post by Narita » Tue Sep 09, 2008 9:53 am

Thank You David.

I understood that it requires to have atleast 2 data points to plot the graph(the line).

I solved my problem by using the api, renderer.setShapesVisible(true); of the renderer.

This has helped me to show dots for the data points. So in case there is just one data point, one dot is solving the problem to show the value.

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Tue Sep 09, 2008 1:11 pm

I'm not David but you're welcome

Locked