|
Multiple charts realtime |
Posted by den on Jul-14-2014 21:49 |
|
Hello!
I need to draw about 50 charts in the realtime(update frequency is 100 - 200 ms). Some of charts are financial, such as HLOC.
Is the ChartDirector capable for such task, and if yes what the best approach to do that?
For example: use dynamic layers, or redraw whole charts, or maybe something else...
Thanks for answer. |
Re: Multiple charts realtime |
Posted by Peter Kwan on Jul-15-2014 02:05 |
|
Hi den,
Are you trying to create 50 charts within 100ms, which would be around 1 chart every
2ms?
The main factor in the speed of creating charts is the number of pixels on the chart. For
example, if each chart is 1200 x 800 pixels in size, it probably cannot run that fast, but
then it is not possible to display 50 charts of that size on the screen either (the screen is
not big enough). if each chart is 150 x 150 in size, and you have a fast computer, and
the chart is not very complicated, ChartDirector can probably draw a chart within 2ms.
Are you planning to display the 50 charts on the screen on the same computer that
generates the chart? Note that you only need to redraw the chart if it is visible. If all 50
charts are visible, each chart is probably very small in size.
The best approach the redraw charts is to completely redraw them. It is because as the
chart is updated, many pixels can change. For example, if the chart needs to scroll,
almost all pixels need to change. If new data point falls outside the y-axis range (eg. the
y-axis is from 37.5 to 38.6, and the new data point is at 39), ChartDirector would need
to rescale the y-axis and a lot of things will change too. For a percentage bar chart or a
pie chart, if a data value change, the percentages of everything changes. If you display
the last data value in the legend box or on the y-axis (as in some financial chart style),
the legend box or axis needs to change. It is not easy to keep track of what needs to
change and what does not need to change in all possible chart styles. On the other
hand, redrawing a 150 x 150 chart does not really take much CPU time, and it always
work no matter what needs to be changed.
The dynamic layer method can work if you are sure what has already been drawn does
not need to change when new data come in, but this can be difficult. For example, it is
difficult to determine the y-axis scale in advance before you have any data coming in.
Regards
Peter Kwan |
Re: Multiple charts realtime |
Posted by den on Jul-15-2014 06:57 |
|
OK. Thank you for answer. I'll reconsider my design using your suggestions. |
|