0
votes

I am using charts_flutter package to display charts in my flutter app, as far as I know, we use labelAccessorFn to show labels in Pie Chart but it's not working for time series line chart.

For the Bar chart, We can add the label as below https://google.github.io/charts/flutter/example/bar_charts/horizontal_bar_label

I want to implement the same for the time-series line chart.

So I have added labelAccessorFn: (TimeSeriesSales sales, _) => sales.sales.toString(),

at https://github.com/google/charts/blob/master/charts_flutter/example/lib/time_series_chart/simple.dart

but Not get success

1

1 Answers

-1
votes

You can use RangeAnnotation for the same which provides label styling as well.

behaviors: [charts.RangeAnnotation(new charts.LineAnnotationSegment())]

Change the properties as per your requirement. I wanted to show a custom vertical line as well.