Skip to content

Settings and activity

1 result found

  1. 22 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Bart van Andel commented  · 

    I've taken David's jsfiddle and managed to produce a pretty satisfying result by splitting each series into a positive and a negative component. E.g.,

    `[-500, -100, 200, 300]`
    becomes
    `[0, 0, 200, 300]` and
    `[-500, -100, -epsilon, -epsilon]`.

    Here, epsilon is a very small number, e.g. 0.00001 (depending on your data), such that all values are absolutely less than 0.

    The series are then put into the series array, first the positive versions, and then the negative series in reverse order.

    Unfortunately there isn't a straightforward way to fix the legend, which will now contain each series title twice, but at least the chart looks ok.

    See my JSFiddle: http://jsfiddle.net/bavanandel/3t5ez/