Search code examples
chartscodenameoneclickable

Codename one - clickable bars in bar chart


I want to implement a bar chart that has clickable bars. To create a custom bar chart I created a class that extends BarChart. Class BarChart has a method that might be useful:

clickableAreasForPoints(java.util.List<java.lang.Float> points, java.util.List<java.lang.Double> values, float yAxisValue, int seriesIndex, int startIndex)

I would like an explanation for the parameters. The doc. is a bit confusing to me.

Parameters:
points - the array of points
values - the array of values of each point
yAxisValue - the minimum value of the y axis
seriesIndex - the index of the series to which the points belong
startIndex - the start index of the rendering points

Are "points" x values and "values" the y values? What is startIndex exactly?

EDIT: All my data is stored in an ArrayList where the indexes represent X values and the value at an specific index is the Y value.


Solution

  • I think you don't need to override that. Sorry for the bad documentation we inherited that from the AChartEngine code that we forked so I'm not familiar with that either.

    The API is there for internal use and it implements the protected void seriesReleased(SeriesSelection sel) callback.

    I think you should be able to override that and get a callback when a column is clicked.