MPAndroidChart to ios-charts syntax examples

The ios-charts framework says to use the "android" documentation. However it turns out that there is enough difference in the properties each framework uses that it can be frustrating to learn how to use the ios-charts library. Here is a quick reference.

ValueFormatter interface

Android: Simple Formatter

// usage on axis, could also use on data object or datasetyAxis.setValueFormatter(newMyValueFormatter());

iOS: Simple Formatter

varmyValueFormatter=NSNumberFormatter()// normal value formatter configurationmyValueFormatter.numberStyle=.PercentStyleyAxis.valueFormatter=myValueFormatter// usage on axis, could also use on data object or datasetvarleftAxis=chart.getAxis(ChartYAxis.AxisDependency.Left)

Android: Custom Formatter

publicclassMyValueFormatterimplementsValueFormatter{privateDecimalFormatmFormat;publicMyValueFormatter(){mFormat=newDecimalFormat("###,###,##0.0");// use one decimal}@OverridepublicStringgetFormattedValue(floatvalue){returnmFormat.format(value)+" $";// append a dollar-sign}}