0

i am trying to implement chart using syncfusion_flutter_charts and the requirement i have is for this is for X-Axis i want to group day with month and year. Watever data i have for date i want to show as X-Axis value and for that i am using CategoryAxis as primaryXAxis and the value should be date. In the axisLabelFormatter i am modifying the format of date i want to show but the issue is i wanted to group by month and year as specified in image. is there are any way we can achieve this with syncfusion_flutter_charts?

Sample data for chart is as given below where there could be multiple data for same date which should appear as separate bar and month and year should have groping according to date.

MedicalTest("2023-03-16 16:43:00", 35),
MedicalTest("2023-03-16 18:20:25", 28),
MedicalTest("2023-02-22 04:05:42", 34),
MedicalTest("2023-02-23 08:52:23", 52),
MedicalTest("2023-01-27 07:34:07", 34),
MedicalTest("2022-12-14 15:27:08", 89),
MedicalTest("2022-12-15 08:17:05", 65),
MedicalTest("2022-12-15 09:42:17", 79),
MedicalTest("2023-11-19 12:29:39", 52)

or any other lib there which allows this type of formatting for date?enter image description here

shilpa vania
  • 11
  • 1
  • 3
  • share the implementation code with the sample data to replicate the output. – Niladri Raychaudhuri Apr 18 '23 at 09:28
  • try https://api.flutter.dev/flutter/package-collection_collection/groupBy.html – Md. Yeasin Sheikh Apr 18 '23 at 10:08
  • @NiladriRaychaudhuri i have added sample data for chart. – shilpa vania Apr 19 '23 at 04:11
  • @shilpavania From your sample data, it seems like you need a time series chart. You could get details here. https://www.syncfusion.com/kb/12289/how-to-render-flutter-time-series-chart-using-the-charts-widget-sfcartesianchart. If this does not serves your purpose, try for HighCharts : https://pub.dev/packages/high_chart/example which provide very rich charting experience in DateTime Axis or TimeSeries chart. – Niladri Raychaudhuri Apr 19 '23 at 04:37

0 Answers0