Home Forums Chart Support Single data row barcharts showing 1, -1 rows

Single data row barcharts showing 1, -1 rows

Viewing 2 posts - 1 through 2 (of 2 total)
  • #38166

    I am seeing a strange thing when the data we retrieve consists of a single row being shown on a barchart. This does not happen if the row count is greater than 1. We see a row above the bar with a X label of “-1” and a row beneath the bar with X label of “1”.

    Is this a bug or perhaps some leftover code meant to be removed for the single row case?

    I have screenshots to share if needed.

    #38266

    @kfox,

    In case of numeric axis chart, labels will be shown at every interval of the axis. Because of this, it’s showing 1 & -1. If there is just one datapoint and your requirement is to show label just for datapoint, you can use category axis (use label instead of x-value). Please take a look at this JSFiddle for an example.

    JavaScript Bar Chart with Category Axis


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.