Closed danielkrizian closed 10 years ago
https://github.com/danielkrizian/dygraphs/blob/ribbon/tests/ribbon.html
Like this but turned into a plugin?
Yes, that's the idea. Maybe with some friendly default opacity to not interfere with series lines visibility.
Information in encodedColors
shall be part of the data
argument, similar to canvasAnnotations
solution, but simpler. Maybe array is not necessary, just column. For each row, a color code. If a code is missing for some rows, assume "none".
New Dygraph
option:
ribbon: {datacolumn, palette, height, position} //height as a fraction of canvas y height, position y coord where 0 is bottom of the canvas
What do you think?
I got your idea, seems doable.
Hello Daniel!
Please check the ribbon demo in tests/ribbon.html
.
One note. I decided not to implement datacolumn
option but implemented more generic ribbonDataParser
function option instead. Also, I implemented the ability to provide ribbon colors array in ribbonData
option parameter as well.
Please, let me know what do you think. Thanks!
Hi Petr, good work! I agree it is better like that. I am assuming that you've updated http://danielkrizian.github.io/dygraphs/dygraph-combined.js and will test it on the real data.
I am closing this item now, thanks again!
I'll merge ribbon
branch into master
tomorrow morning and also I'll rebuild dygraph-combined.js
.
After that I'll close this issue.
Color regions that comprise the ribbon can be different for each date. User supplies an array of numeric values and color palette (gradient), where each numeric value encodes a position in the palette interval.
Simplified idea using
underlayCallback
is here: http://dygraphs.com/tests/highlighted-region.htmlDesired result (when using red-green palette):