Home Forums Chart Support bars to start from -150 and only extend upward to the specified values. Reply To: bars to start from -150 and only extend upward to the specified values.

#44293

@ajit,
You can use Range Column Chart to show base of the column at -150 by passing the first y values as -150 and second value same as your existing y value for column chart. Please take a look at the code snippet for the converting column to rangeColumn and starting column at -150.


for(var i=0; i<chart.options.data[0].dataPoints.length; i++) {
  chart.options.data[0].dataPoints[i].y = [-150, chart.options.data[0].dataPoints[i].y]; 
}
chart.options.data[0].type = "rangeColumn";

Also, check out this JSFiddle for complete working code.

Column Starting from -150

—-
Manoj Mohan
Team CanvasJS