You must be logged in to post your query.
Home › Forums › Chart Support › Remove Spacing Between Columns in Bar Graph
I really need to remove the spacing between columns in the CanvasJS column chart (bar graph). I don’t want any gap between the bars. I’ve searched and as of last time this question was asked (2018) it was noted CanvasJS didn’t support having no gap between columns. I hope that now that it’s turning 2020 there is a fix because it’s imperative to my chart. Please let me know, thank you!
@dmehta,
By setting dataPointWidth based on axis width and number of dataPoints in column chart, histogram chart can be rendered. Please take a look below code snippet for the same
chart.set("dataPointWidth",Math.ceil(chart.axisX[0].bounds.width/chart.data[0].dataPoints.length),true);
Please check this JSFiddle for complete code.
— Manoj Mohan Team CanvasJS
@manoj-mohan, its working fine. how can we manage the datapoint width to remove spaces with zoom feature? Thanks!
@zahid,
Sorry, it’s not possible to remove space between columns on zooming as of now.
—- Manoj Mohan Team CanvasJS
You must be logged in to reply to this topic. Login/Register