ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.52k stars 5.99k forks source link

[Enhancement] do not draw data if the data is going to be highlighted #573

Open liuxuan30 opened 8 years ago

liuxuan30 commented 8 years ago

Found an issue today while adding transparency to highlight color, which is white color + 0.5 alpha.

Then I found that it's not pure white, with a little blue, which is the data set color, because we perform drawData before drawHighlighted, so every data is redrawed and being highlighted above. This seems can be improved, if we found some data is going to be highlighted, we can avoid draw it.

danielgindi commented 8 years ago

Well currently the highlight is an overlay over the data, which I think (but may be wrong) is the case that is wanted in most cases. Imagine a dot - where the highlight can be a circle around it, or a data bar - where the highlight can be a blue half-transparent overlay, or even a rainbow above ;-)

We may want to add a flag for avoiding to draw highlighted data for certain cases? Or can we be satisfied by assuming that we can always clear the area and draw the highlight from scratch?

liuxuan30 commented 8 years ago

I would prefer adding a switch to allow overlay or not. As you know People have different demands :) all your assumptions are valid, some want draw out circle around the data, others want some transparency.

My UE folks want a pure half-transparent white hole with an outter stroked circle, LOL

danielgindi commented 8 years ago

:-)