0's of X and Y coordinates do not intersect

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

0's of X and Y coordinates do not intersect

Post by Sriram Nookala » Thu Apr 25, 2002 4:10 pm

I have the following piece of code for creating the category data:

String[] seriesNames = new String[] {"Usage"};
String[] categories = new String[] {"0","10","20","30","40","50",
"60","70","80","90","100"};

Number[][] dataArray = new Integer[][] {
{new Integer(0), new Integer(30),new Integer(50),new Integer(65),
new Integer(80),new Integer(85),new Integer(90),
new Integer(93),new Integer(96),new Integer(99),new Integer(100)}
};

return new DefaultCategoryDataset(seriesNames, categories,dataArray);

I need to have my graph start from the beginning(intersection of X,Y axes starting from 0), I however notice that the 0 on the X axis does not match up with the 0 on the Y axis. How can I fix this to start from the beginning?

David Gilbert

Re: 0's of X and Y coordinates do not intersect

Post by David Gilbert » Thu Apr 25, 2002 4:57 pm

You should probably use XYDataset rather than CategoryDataset for your data, since the domain appears to be numerical.

Regards,

DG.

Locked