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

Message ListMessage List     Post MessagePost Message

  Real Time Pie/Speedometer Type Chart
Posted by Rahul Ashok on Apr-21-2014 19:29
Hi All,

I have a set of data in my database that i would like to view in real time as a pie /
speedometer type graph in jsp.

I was successful in connecting my database to the Real Time Line chart example
(realtimedemo and realtimechart.jsp), and its working really well.

Could someone assist me in getting this same result in a pie chart?

Thanks in advance!!

Rahul Ashok,
Researcher,
Singapore University of Technology and Design

  Re: Real Time Pie/Speedometer Type Chart
Posted by Peter Kwan on Apr-22-2014 01:07
Hi Rahul,

A realtime chart is just a chart that is periodically redrawn using the latest data. You can
use any chart type you want. For example, in the "realtimedemo.java" sample code, you can
replace the code in the "drawChart" routine to draw a pie chart instead of a line chart.

The key issue in the realtime chart is how the data should be updated. In the original
sample code, the data are updated by append the new data point at the end of the data
series, and removing the oldest data point from the data series. When the data series is
used to plot a line, it would like like the line has scrolled, with the new data point scrolling in
from the right, and the oldest data point dropping outside the plot area at the left.

For the pie chart, you would need to decide how to update the data. For example, would
you append a new sector to the pie (provide a new data value and a new label), and also
remove the oldest sector from the pie? Or do you want to just reload the entire data series
and labels from the database (assuming the database are keeping the data for all the
sectors and there are other process that update the database in realtime)?

For the speedometer, it is simple. Simple obtain the latest value from the database and use
it as the data value for the speedometer.

Hope this can help.

Regards
Peter Kwan

  Re: Real Time Pie/Speedometer Type Chart
Posted by Rahul Ashok on Apr-22-2014 17:48
Thanks a lot Peter.

One more query. Is there a built-in speedometer type chart available with the
chartdirector api?

Regards
Rahul

  Re: Real Time Pie/Speedometer Type Chart
Posted by Peter Kwan on Apr-23-2014 04:25
Hi Rahul,

ChartDirector has built-in support for meters and gauges. See:

http://www.advsofteng.com/gallery_meter.html

You may look up "Meters and Gauges" from the ChartDirector documentation index for some
sample code.

Hope this can help.

Regards
Peter Kwan

  Re: Real Time Pie/Speedometer Type Chart
Posted by Rahul Ashok on Apr-30-2014 17:32
Thanks a lot Peter. It really helped.

Appreciate it. :)

Regards
Rahul