Dynamic datasource

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

Dynamic datasource

Post by Scott Waits » Thu Mar 08, 2001 9:06 am

I am not successfully able to dynamically add values to my data
source. My line chart displays if I place values in my Number array
as such:

Number[][] data = new Integer[][]
{ { new Integer(0), new Integer(5)} };

However, the data source is not recognized when I populate the
Number array like this

Number[][] data = new Integer[][] { };

data[0][0] = new Integer(0);
data[0][1] = new Integer(5);

Does anyone know what I am doing wrong?

Any clues would be appreciated.

Thanks,

Scott

Sudha Sundaram

RE: Dynamic datasource

Post by Sudha Sundaram » Tue Mar 13, 2001 8:35 pm

Hi,

You seem to have one series and two categories of data, from what you have mentioned.
------------------------------

Number[][] data = new Integer[][] { };

data[0][0] = new Integer(0);
data[0][1] = new Integer(5);
-------------------------------------------
Create the array by

Number[][] data = new Integer[1][2];
then say,
data[0][0] = new Integer(0);
data[0][1] = new Integer(5).
this should work.

Sudha

Locked