mzimmerm / flutter_charts

Charts Library for Flutter, written in Dart with Flutter.
Other
250 stars 42 forks source link

Ordering of paints for overlapping lines #6

Closed MichaelRFairhurst closed 6 years ago

MichaelRFairhurst commented 6 years ago

Hey Milan,

I noticed that if I make two lines in the line chart, it seems that the first line gets painted before the second line. Could this be reversed?

The reason here is that the first line's legend shows up first in the chart, so it should be the "prioritized" line most of the time. However, if the second line overlaps it, it will be drawn over the first line.

This makes it hard to clearly prioritize one line over another -- its either later in the legend, or its underneath the rest.

mzimmerm commented 6 years ago

Hi Michael,

Yes that makes sense, although I did not fully "realize" the ordering is like this but yeah, I think the lines are painted in the order of the "data rows", so the last line "wins/overlaps" those below. It can definitely be reversed, although I think we should provide an option. Default would be the first line in the series (corresponding to the left-most colored square) is painted last, is that what you meant? I think I can do this this weekend, maybe earlier.

Thanks, this is very useful, Milan

MichaelRFairhurst commented 6 years ago

Yep, I read your comment as exactly what I was trying to say!

No real rush, I'm also working on my app when I get time between other things :)

mzimmerm commented 6 years ago

@MichaelRFairhurst : Michael, I published a new version that addresses and should fix items 5, 6. Please take a look at https://pub.dartlang.org/packages/flutter_charts#pub-pkg-tab-changelog for details.

Let me know if there are some issues with the two.

I started working on item 3 (planning for now by a simple iterative X labels layout that will either/or tilt/skip labels. Later, Milan

MichaelRFairhurst commented 6 years ago

Works great! Sorry for the delay in responding.