PiRSquared17 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

When multiple area series are present, draw all lines above all shaded regions #730

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is either an enhancement or a bugfix, depending on how you look at it.

If you two series (or more), both of which have a fill specified (i.e. shaded 
between the series line and the axis), in certain circumstances the series line 
from one series will be behind the shaded region of the other series. This is 
because flot renders the shaded region and series line in sequence, rather than 
rendering all shaded regions, followed by all series lines.

In my own code, I have solved this by adding a flag named "areaOnly" to 
drawSeriesLines(), adding a function named drawSeriesArea which calls 
drawSeriesLines with that flag set to true, and modifying the draw() function 
to loop through series twice, firstly to call drawSeriesArea(), and secondly to 
call drawSeries(). drawSeriesArea does the same checks on series type as 
drawSeries. For good measure I also added hooks.drawSeriesArea.

My modified flot.js is attached.

Original issue reported on code.google.com by james.du...@gmail.com on 31 Jul 2012 at 3:35

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 31 Jul 2012 at 1:36