Home Forums Chart Support Y-Axis label for baseline is hidden when using axisY.minimum

Y-Axis label for baseline is hidden when using axisY.minimum

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

    I have a chart (JSFiddle) where I manually set the minimum value of the Y-Axis, however the label for the baseline Y-Axis is empty, when it should be displaying 30.

    I noticed that the baseline y-axis label always appears to be empty, UNLESS I set the y-axis minimum to be a number that is a multiple of the interval that’s calculated under the hood.

    e.g. if CanvasJS computes the interval internally to be 20, and I set the y-axis minimum to 20/40/60/etc it shows a value. If I set the y-axis minimum to any other number the label appears blank.

    Is there a workaround to have this value show up? If not then this should be prioritized as a bug to fix since it’s critical to our product, thanks!

    #33646

    @agaur,

    Label are shown at a value which is multiple of interval. To show label at the bottom of y-axis, you can add a stripline & set it’s label-placement to outside. Below is the code snippet showing the same.

    var axisY = chart.axisY;
    axisY.addTo("stripLines", {
      value: axisY.viewportMinimum,
      label: axisY.viewportMinimum,
      labelPlacement: "outside",
      labelFontColor: axisY.labelFontColor,
      color: axisY.tickColor,
      labelBackgroundColor: chart.backgroundColor,
      thickness: 0
    });

    Please take a look at this JSFiddle for complete code.
    Chart with Label at Viewport Minimum of Axis


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.