opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
53 stars 41 forks source link

[In-App Reporting] Implement charts and graphs for In-App reporting #1867

Open f-odhiambo opened 1 year ago

f-odhiambo commented 1 year ago

Is your feature request related to a problem? Please describe. Implement the data visualization for the generated indicators for the In-App reporting modules

Describe the solution you'd like Use Jetpack compose to implement charts and graphs for in-app reporting

Describe alternatives you've considered Use custom libraries to generate charts and graphs after validating the limitations of using Jetpack compose for this

Acceptance criteria

  1. Add the ability to support multiple charts and graphs
  2. Able to configure the color for each area in a chart (pie chart)
  3. Show the label/test for each area proportion
  4. Add the key/legend to describe the regions in the chart

Sample chart

Screenshot 2022-11-29 at 10 07 09 AM

Additional context

  1. Mockups available here
  2. Sample pie chart in jetpack compose https://www.geeksforgeeks.org/pie-chart-in-android-using-jetpack-compose/
ahsanbhatti49 commented 1 year ago

@f-odhiambo There is no implementation of MP Charts library in compose ui. We can communicate with xml in compose. My concern is around the usage.. If we only need pie chart,bar chart and line graph. Why do we need to add a 3rd party library written in xml and java which has a bunch of other charts/graph feature as well. ? We can write our own jetpack compose implementation of pie chart/bar chart and line graph. Need your opinion on this

cc: @ellykits @maimoonak

f-odhiambo commented 1 year ago

@f-odhiambo There is no implementation of MP Charts library in compose ui. We can communicate with xml in compose. My concern is around the usage.. If we only need pie chart,bar chart and line graph. Why do we need to add a 3rd party library written in xml and java which has a bunch of other charts/graph feature as well. ? We can write our own jetpack compose implementation of pie chart/bar chart and line graph. Need your opinion on this

cc: @ellykits @maimoonak

The aim is to build using compose as a 1st priority and not focus on using the MP Charts library in compose UI The idea of the ticket as how it is written is to provide both the happy path and also an alternative if we encounter issues with that solution. So using compose we build a chatting and graphing lib that will allow passing data and the type of required visualization and it does its magic