Rolando
Rolando

Reputation: 762

how to draw column with value=0 in highcharts

I have a chart where and I would like have a line/bar when the y-axis value is zero.. (that because zero is a correct value and null is a absence of value).is that possible? For example in the column-basic chart (http://www.highcharts.com/demo/column-basic). is possible have a value=0 for tokio serie?.. so be draw it?

    {
        name: 'Tokyo',
        data: [0, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]

    }

I tried min property to a value less to zero.. but the bar is not visible... any idea?

Upvotes: 0

Views: 416

Answers (2)

jlbriggs
jlbriggs

Reputation: 17800

minPointLength is what you are looking for:

Upvotes: 0

Kacper Madej
Kacper Madej

Reputation: 7896

Set minimum of yAxis below 0 and threshold to null (that way the columns extend from the padding Y axis minimum) Highcharts API: plotOptions.bar.threshold

Example: http://jsfiddle.net/4w23mrod/

...
yAxis: {
   min: -50,
   ...
},
plotOptions: {
   bar: {
      threshold: null,
      ...

OR

You can use minPointLength

Example

Upvotes: 2

Related Questions