swathi Posted December 11, 2007 Report Share Posted December 11, 2007 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); Quote Link to comment Share on other sites More sharing options...
GabrielA Posted December 12, 2007 Report Share Posted December 12, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.