I’m using Teechart Java Android source code v3.2013.1219.
I'm having some issues presenting real time data using a Bar chart along a scroll pager.
I have modified the class WIFIStatistics in the Android teechart sample to present what I'm trying to achieve.
As you can see in the attached file, when pressing the "Start scan" button, a timer is initialized to retrieve data for a few times, representing the case where a real time data flow would need
to update the graphs. 1. Issue to update the subchart
The main chart is updated without any issue. However, in order to update the subchart I ended using the following code( after a lot of tries with other functions that
did not update the subchart)
Code: Select all
// Remove series from the scroll pager
ScrollPager s = (ScrollPager)chart.getTools().getTool(0);
if (s != null) {
TChart scrollPagerChart = s.getSubChartTChart();
scrollPagerChart.removeAllSeries();
s.setSeries(null);
}
How can I achieve it?
2. Issue to configure and retain state of the subchart's colorband
I need to support the following case:
a. Initially, the colorband is drawn at the default position (middle of x axis)
b. If the user changes the position or the size of the colorband, while the charts are updated in real time, the colorband should be drawn at the new position and its size
should be updated accordingly.
I tried different functions from the library and tried to implement relevant events to accomplish this, however, unsuccessfully.
Currently, the code used in the attached sample uses the default configuration of the colorband each time it gets updated. If you try to move the colorband while
the subgraph is updated, you will get an exception.
Could you please provide some sample code how to retain the colorband's position and size and also avoid the exception?
This feature is very important for the functionality I'm implementing.
Thank you in advance,
E.