Jump to content
Software FX Community

Sample code required


swathi

Recommended Posts

Iam trying to create one scatter chart.  The values are coming from the Resultset and now i would like to plot the points. The below syntax is for plotting. Could you please tell me the sample code for plotting the points which are coming from the Resultset.

chart1.openData(COD.VALUES, 1, COD.UNKNOWN);

int j = 0;

while (Fetching Records)

  {

  chart1.setValue(0, J, value);

  j = j + 1;

  }

chart1.closeData(COD.VALUES);

Link to comment
Share on other sites

There is a whole section in the documentation about Passing Data, and in particular about passing data from resultsets.  There are several samples included.

If yor resulset has only the data you want to plot in the chart, then is as simple as:

JDBCDataProvider provider = new JDBCDataProvider(Resulset);

chart1.setDataSource(provider);

You may need to use the DataType and DataStyle, for example, if you resulset has 3 columns, and you want to use one as labels and the rest as data:

chart1.getDataType().setItem(0,DataType.LABEL);

chart1.getDataType().setItem(1,DataType.VALUE);

chart1.getDataType().setItem(2,DataType.VALUE);

Again, see the Passing Data section of the docs for more detail.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...