lecho / hellocharts-android

Charts library for Android compatible with API 8+, several chart types with scaling, scrolling and animations 📊
Apache License 2.0
7.44k stars 1.61k forks source link

changing colors of points #457

Open lonewolf9277 opened 6 years ago

lonewolf9277 commented 6 years ago

Hi, I am looking to for a charting library that supports the following:

  1. Able to put horizontal lines or markers on line chart
  2. All points about a specific limit should be a different color say red and all points below should be a different color (eg green).
  3. This should happen in a realtime graph.

Some other libraries I have tried don't have these options. Does this library have these options?

lecho commented 6 years ago

Hey, I think it will require some additional work and hacks to achieve that with this library. I would try to add two different sets of points, first set will hold values below the limit and the second one above the limit. Then I would also add horizontal line(only two connected points) to mark the limit. LineChartData has an option to hold multiple Line objects. You can turn Line into set of points by setting Line.hasLines=false. That's only an idea for the start. I'm not sure if that would work, especially for realtime graph. I'm also not active in this repo any more so I don't have plans to add something like that. Hard to say if some other library can do that. Only way to be sure is to try some of them.