Hello everybody,
I'm using the constructor:
public DefaultCategoryDataset( java.lang.Number[][] data)
but i don't know what is a java.lang.Number???
when i put :
Number number[][] = {{2, 10, 40} , {8, 12, 3}}; it's false, and i don't understand why??
thanks for help,
sido.
java.lang.Number
Re: java.lang.Number
try this
Number number[][] = {{new Integer(2), new Integer(10), new Integer(40)} , {new Integer(8), new Integer(12), new Integer(3)}};
Double/Integer... are an implementation of the abstract class java.lang.Number.
Number number[][] = {{new Integer(2), new Integer(10), new Integer(40)} , {new Integer(8), new Integer(12), new Integer(3)}};
Double/Integer... are an implementation of the abstract class java.lang.Number.
Re: java.lang.Number
thank you, i found the solution, it's what you wrote.
but i have another pb:
how can i create a Graphics2D object?? i need one to draw:
chart.draw(Graphics2D g2, Rectangle2D chartArea, DrawInfo info);
thanks for your help,
sido.
but i have another pb:
how can i create a Graphics2D object?? i need one to draw:
chart.draw(Graphics2D g2, Rectangle2D chartArea, DrawInfo info);
thanks for your help,
sido.
Re: java.lang.Number
sido wrote:
>
> how can i create a Graphics2D object?? i need one to draw:
>
> chart.draw(Graphics2D g2, Rectangle2D chartArea, DrawInfo
> info);
You don't usually create a Graphics2D, you obtain one from somewhere. If you want to output your charts on screen, use the JFreeChartPanel class - it overrides the paintComponent method in the JPanel class, grabs the Graphics2D object and draws the chart.
Regards,
Dave Gilbert
>
> how can i create a Graphics2D object?? i need one to draw:
>
> chart.draw(Graphics2D g2, Rectangle2D chartArea, DrawInfo
> info);
You don't usually create a Graphics2D, you obtain one from somewhere. If you want to output your charts on screen, use the JFreeChartPanel class - it overrides the paintComponent method in the JPanel class, grabs the Graphics2D object and draws the chart.
Regards,
Dave Gilbert