Here are some common mistakes you could have occasionally done:
- You forgot to call
updateData()
of the chart or called it in the wrong place. The proper initialization sequence is:
- Create series.
- Set data source to ALL series.
- Add series to the chart.
- Call
updateData()
.
- You return null of too few points from your implementation of
NChartSeriesDataSource
. Some series like Surface or Line need more than one point to be displayed. Check your implementation ofNChartPoint[] points(NChartSeries series)
method. - You did not retain data source for series in the member variable. This is probably the most common but also most non-obvious pitfall. Chart stores data source in a weak reference. This means, if you don't retain it somewhere outside of the chart, it will be cleaned by GC.
- Calling
beginTransaction()
you forgot to callendTransaction()
. You have to callbeginTransaction()
if you use another thread to update data, and you have to callendTransaction()
in the end of your updating method.
Comments
No comments yet.
Please log in to place a comment.