Home Forums Chart Support y-Axis Scaling

y-Axis Scaling

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

    Hi all,

    I have a simple problem.. but I really getting it not solved. I try to define my y-Axis range (max:100, min: 50) and tried to follow the documentation. However, scaling does not react at all. My code is the following:

          window.chart1 = new CanvasJS.Chart("chart1ContainerDisk", {
            animationEnabled: true,
            theme: "light2",
            title: {
              text: title,
              fontSize: 14
            },
            axisX: {
              title: xtitle,
              titleFontSize: 13,
              includeZero: false
            },
            axisY: {
              title: ytitle,
              titleFontSize: 13,
              includeZero: false
            },
            data: [{
              type: "line",
              indexLabelFontSize: 12,
              dataPoints: arr_Datapoints
            }],
            options: {
              scales: {
                yAxes: [{
                  ticks: {
                    min: 50,
                    max: 100
                  }
                }]
              }
            }
    
          });
          window.chart1.render();

    Can someone tell me what is wrong with that code?
    Thank in advance, Cheers
    J

    • This topic was modified 4 years, 6 months ago by Tschounes.
    #29061

    @tschounes,

    It seems you are not using valid chart options to set the axis range. You can set the range of axisY by setting minimum and maximum properties, please refer documentation for live examples & more customizations available.


    Vishwas R
    Team CanvasJS

    #29087

    Thanks, that worked.
    Is there something like the “suggestedmin” function: when datapoints are between the min-max values the max and min values are taken, if there outside the larger value is used.

    Thanks for your support!

    #29111

    @tschounes,

    Is there something like the “suggestedmin” function: when datapoints are between the min-max values the max and min values are taken, if there outside the larger value is used.

    Sorry, we don’t have such option as of now.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.