|
Realtime chart with table |
Posted by ahmad jibril on Oct-10-2009 23:16 |
|
Hi peter
I am using CD-Coldfusion, I have set of database (db), this db will be filled in automatically from the measurement hardware. I ask CD to display my data in a chart as real time using the real time chart. But I want to display the result table below the real time chart (in real time), I try to look for from the other example, but all the CD using the chart nothing in table. Can you help me?
Thanks in advance
ahmad |
Re: Realtime chart with table |
Posted by Peter Kwan on Oct-12-2009 10:40 |
|
Hi ahmad,
I am not sure the type of table you want to create. ChartDirector is basically a charting software. For creating tables, most people using HTML. (There is a <TABLE> tag in HTML.)
In your case, you may write a web page that contains a HTML table, and try to update it in realtime. This part should not be related to ChartDirector. (It is just normal ColdFusion / HTML code.) After you have successfully do this, you can put your realtime HTML table under the chart, like:
<!-- ****** Here is the image tag for the chart image ****** -->
<img id="ChartImage1" src="realtimechart.cfm?chartId=demoChart1">
.... put your real time HTML table here ....
For simple tables using enumerated axis (axis with a few equally spaced labels), you can also use ChartDirector to dock a table to the axis. See the sample code "Data Table (1)" and "Date Table (2)". However, as ChartDirector is basically a charting software, and not a word processor or a text layout engine, it is suggested you use HTML for more general tables or other text layout.
Hope this can help.
Regards
Peter Kwan |
Re: Realtime chart with table |
Posted by ahmad jibril on Oct-16-2009 15:36 |
|
Dear,
I know how to write table using html. I am using a realtime chart to display my data (time series data) the data got from DB, the DB filled in realtime by the measurement hardware, the speed in milisecond each row of data. when I start realtime chart the data will query top of 50 data from my DB and display every 1 second. My problem is, if I make the table below the realtime chart and query my DB as in my real time chart(top of 50 data), the data not same as in realtime chart, because the table and realtime chart not process same time to get the data from DB. So what I need, I run my realtime chart and the same data in real time chart display in table as well. how to make chart and table will show same data?.
Thank's in advance.
rgds
ahmad |
Re: Realtime chart with table |
Posted by Peter Kwan on Oct-16-2009 23:05 |
|
Hi ahmad,
To solve the problem, you can only query the DB only once per second, and use the same data for the chart and the table. In this way, the chart and the table will always use the same data.
For example, suppose you want to update the chart first, then immediately followed by the table. You can query the database in the charting code, and store the data in a session variable. When the table is drawn, it can use the data in the session variable, which is the same data used to create the chart.
Hope this can help.
Regards
Peter Kwan |
|