Jump to content
Software FX Community

Sample code required


swathi
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...