Access Chart point Value on iOS and Android


#1
  1. How to get and show point data values in every chart , like having point values at every column tip in Column and Bar series or on every slice in pie chart?

 2) How to have access to single column , line or slice views to change its property?


#2

Hello Jaber

Usually you can retrieve your data points from your series by first retrieving its DataAdapter. Once you have the DataAdapter, there are a number of methods to allow you to retrieve the data points within it. 

Once you have a list of your data points, you can then use Annotations to display them. You have a number of options with Annotations, ranging from simple text based, to custom View Annotations. Please note, Annotations are a premium feature.

You can find the various methods which will help you achieve this in our api docs, which can be found here:

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/package-summary.html

For Pie Series labels, you may find this tutorial helpful:

I hope that this helps,

Thanks,

Kai


#3

Hi Jaber,

To address your points with regards to iOS:

1) How to get and show point data values in every chart , like having point values at every column tip in Column and Bar series or on every slice in pie chart?

On iOS I’d recommend using datapoint labels. These can be turned on like so:

series.style.dataPointLabelStyle.showLabels = YES;

 If you wish to style these labels you can use the delegate method sChart:alterDataPointLabel:forDataPoint:inSeries:

On a Pie Series you can turn labels on by doing

pieSeries.showLabels = YES;

2) How to have access to single column , line or slice views to change its property?

  • Bars and columns can be styled on a per point basis by subclassing the Bar/Column series and overriding styleForPoint:. You may find this post useful.
  • We don’t support individual styling of sections on a line series. If you wish to do this, you’ll have to create a separate series for each section of your line that you wish to change the style of.
  • You can alter the slice colors by modifying the UIColor values contained within the SChartDonutSeriesStyle’s flavourColors property.

I hope that helps.

Sam


#4

@sburnstone, how can the data point labels be displayed/styled in Android?


#5

Hello Mohib.

The shinobicharts android library does not directly support data point labels. You can achieve something similar using our annotations api. Please see a link below to the annotations api:

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/AnnotationsManager.html

Please see below a link to our how-to guide on adding annotations to a chart:

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/user-guide/how-to-add-annotations.html

In the download bundle you should also find a sample application which demonstrates how to add annotations to a chart.

I’d also like to mention that data point labels is a feature which is on our backlog.

I hope this helps,

Thanks,

Kai.