ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  get values from table
Posted by lari3 on May-30-2013 07:01
Attachments:
hello Peter,
I have a table w 6 columns,( hops,MAx,Avg,Min,NAme,Add IP)
from this table i will try to take the last column Add IP and i will affiched them in graphics.
So please can you tell me how i can do to take values of last column"add IP" but of all rows
thinkyou.
affichage.jpg

  Re: get values from table
Posted by Peter Kwan on May-30-2013 18:16
Hi lari3,

By "table", I assume you are referring to a database table. If you are using Java, you may write some JDBC code to issue an SQL query to your database to retrieve the columns you need, and read them into Java arrays. You may then use the Java arrays to create the chart you need. You may refer to Java documentation on how to use database with Java (in particular, using JDBC). There are also some examples in the "Using Data Sources with ChartDirector" section of the ChartDirector documentation.

http://www.advsofteng.com/doc/cdjava.htm#datasource.htm

(In the same code, the DBTable.getCol and DBTable.getColAsDate are used to get numeric and date columns. For text string columns, please use getColAsString.)

Hope this can help.

Regards
Peter Kwan

  Re: get values from table
Posted by lari3 on May-30-2013 18:44
hello
thinkyou Peter
but i work without database because i don't need for it

  Re: get values from table
Posted by Peter Kwan on May-30-2013 22:31
Hi lari3,

The key is to read the values you want from your table into an array of text strings (String[] in Java). The exact code depends on what you mean by "table". You would need to develop code that can work with your "table".

Regards
Peter Kwan

  Re: get values from table
Posted by lari3 on May-31-2013 02:41
application corresponds to execute the tracert commnade and display the result in file
texte.then, read file and displayed in the JTable and finally  displayed in the graphic

  Re: get values from table
Posted by Peter Kwan on Jun-01-2013 02:58
Hi lari3,

In this case, you may write some code to get your data from the JTable and stores them into a Java array. It can be something like:

TableModel m = table.getModel();
String[] myLabels = new String[m.getRowCount()];
for (int i = 0; i < myLabels.length; ++i)
    myLabels[i] = m.getValueAt(i, 5).toString();  //read from the 6th column

You may then use the string array in variables ChartDirector API, such as using it for the AngularAxis labels.

Hope this can help.

Regards
Peter Kwan

  Re: get values from table
Posted by lari3 on Jun-01-2013 18:00
think you Peter :)