Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple Threshold in Highcharts
    primarykey
    data
    text
    <p>I'm actually trying to use HighCharts for displaying multiple threshold.</p> <p>Here is the portion of my <a href="http://jsfiddle.net/XndxH/2/" rel="nofollow">code</a>.</p> <p>Especially here :</p> <pre><code>var translatedThreshold = series.yAxis.translate(threshold1), y1 = Math.round(series.yAxis.len - translatedThreshold), y2 = y1 + 2; // 0.01 would be fine, but IE9 requires 2 // Apply gradient to the path series.graph.attr({ stroke: { linearGradient: [0, y1, 0, y2], stops: [ [0, colorAbove], [1, colorBelow] ] } }); // Apply gradient to the area if (series.area) { series.area.attr({ fill: { linearGradient: [0, y1, 0, y2], stops: [ [0, colorAbove], [1, colorBelow] ] } }); } </code></pre> <p>Actually, there is two thresholds, one on 0 and one on 3. </p> <p>For the dots, the threshold is correct (a blue dot is displayed because its value is between 0 and 3 and its color value is ColorMiddle).</p> <p>For the curve, and the area, the colorMiddle values are not displayed though, because I don't know how to add them on the series graph.</p> <p>I think I must use a translatedThreshold2 with series.yAxis.translate(threshold2), and add them on the series.area.attr but I don't know how exactly.</p> <p>Does anyone have an idea ?</p> <p>EDIT1 : I managed to display the threshold line (in blue on the example below) but the area is not filled correctly. The area should be in blue between 0 and 300 and it's the color green (AKA colorAbove, and not colorMiddle).</p> <p>Result is displayed here : <a href="http://jsfiddle.net/LeLwu/27/" rel="nofollow">http://jsfiddle.net/LeLwu/27/</a> (it happens to be different in Chrome and Firefox ...)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload