Closed socketpair closed 1 year ago
Here is the patch:
--- smoothie.js.1<----->2015-02-15 01:26:37.000000000 +0500
+++ smoothie.js>2015-12-08 02:15:18.206009660 +0500
@@ -702,8 +702,9 @@
if (seriesOptions.fillStyle) {
// Close up the fill region.
context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, lastY);
- context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, dimensions.height + seriesOptions.lineWidth + 1);
- context.lineTo(firstX, dimensions.height + seriesOptions.lineWidth);
+ context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, valueToYPixel(0));
+ context.lineTo(firstX, valueToYPixel(0));
+
context.fillStyle = seriesOptions.fillStyle;
context.fill();
}
It works as I expect, Thanks for clear sources, that everyone can understand.
But, it maybe off-by-one errors, since I do not understand meaning of seriesOptions.lineWidth + 1
or seriesOptions.lineWidth
. Please fix that and merge!
Maybe you should add an option to switch between old and this new behaviour.
I don't think you can call this a bug.
6 years... I forgot what I wanted...
Instead of filling from line y=0, it fills from bottom of the screen. This is a bug (!)
I cannot draw two filled series one of the between [0,100] and other [-100, 0] since filled area of that series will overlap, but should not (!)