0
votes

I would like some help with Area chart. If the series values are not 0.0, the minimum value of the chart always set into 0, and it's correctly on the bottom of the chart (ie) y-axis:

I try to set

{ min: 0, minPadding:0 } on the y-axis, but it doesn't work. Obviously I can't set a max value because I have a dynamic data. How can I solve this?

I have tried above cases in line charts its working properly, but not in Area charts?

1
Could you please create a jsfiddle to better assist you! - mustapha mekhatria
It is unclear what your actual question/problem is. What do you actually want, and what about it is not working? - jlbriggs

1 Answers

0
votes

If your issue is to set a max (or min) dynamically, you can use event to set dynamically max and min:

var newMaxValue=60000000;
var newMinValue=10000000;

...

  events: {
    load: function() {
      var check = $('#container').highcharts();
        check.yAxis[0].setExtremes(newMinValue, newMaxValue);
    }

Check the example (jsfiddle):

$(function() {
var newMaxValue=60000000;
var newMinValue=10000000;
  $('#container').highcharts({

      chart: {
      type: 'area',

      events: {
        load: function() {
          var check = $('#container').highcharts();
            check.yAxis[0].setExtremes(newMinValue, newMaxValue);

        }
      }
    },


    series: [{
      "data": [{
        "y": 198975.14,

      }, {
        "y": 15031755.47,

      }, {
        "y": 21374471.88,
      }],
      "name": "Income Statement",
      "yAxis": 0
    }]
  });
});