Stacked Area Spline Chart with negative values misbehaving

MansourMansour ✭✭✭✭
edited March 7, 2017 in Questions
Hi All,

I have an area spline chart with positive and negative values that I am trying to stack.  Ideally, negative values fall below the 0 mark, positive values go above.  For some reason, the area charts don't behave this way (see screenshot).  Column charts work fine.  Any ideas?
image

image

Comments

  • J.J. 💎
    edited March 7, 2017
    Mansour,

    I think the way to address this is a Highcharts setting that we don't currently set: threshold. It looks like it's particular to Area/Areaspline charts, but I wasn't familiar with it before today, so I can't say for sure. Here's a jsFiddle showing it in action. At present, you'll have to set this with a Before Render Snippet on your Chart to set it. Does that help?
  • MansourMansour ✭✭✭✭
    edited January 4, 2017
    Thanks J, that worked great!

    Here's the snippet if anyone else runs into this:


    var chartObj = arguments[0],
    $ = skuid.$;

    $.extend(chartObj,{
        tooltip: {
            shared:true,
            enabled:true,
            crosshairs:true
        }   ,
        plotOptions:{

       series:{
          
       threshold: 0
       }
        }
    });


  • MansourMansour ✭✭✭✭
    edited January 4, 2017
    Spoke too soon, that snippet removed stacking...
  • J.J. 💎
    edited March 7, 2017
    Try a recursive $.extend:
    $.extend(true,chartObj,{ ... (Setting really cool options here) ... }); 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!