Home Forums Chart Support Remove Spacing Between Columns in Bar Graph

Remove Spacing Between Columns in Bar Graph

Viewing 4 posts - 1 through 4 (of 4 total)
  • #27700

    D M

    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!

    #27743

    @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.

    Histogram using Column Chart


    Manoj Mohan
    Team CanvasJS

    #27781

    @manoj-mohan, its working fine. how can we manage the datapoint width to remove spaces with zoom feature?
    Thanks!

    #27796

    @zahid,

    Sorry, it’s not possible to remove space between columns on zooming as of now.

    —-
    Manoj Mohan
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.