Home Forums Chart Support axisY not calculating to 100%;

axisY not calculating to 100%;

Viewing 5 posts - 1 through 5 (of 5 total)
  • #30569

    I want to show axisY to 100% in my spline Chart.

     let na = [];    
          chart.options.data.forEach((val)=>{
            val.dataPoints.forEach((val2)=>{
              na.push(val2.y)
            })
          })      
          maxY = Math.max(...na);
          chart.options.axisY.maximum = maxY;
           
        chart.render();

    above code is working fine but when array contains more then 4 items my axisY showing 89%.

    #30588

    @saqib,

    Can you kindly create a JSFiddle reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you out?

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact requirements or the solution that we provide may not work properly due to the variation in chart-options being used by you and us.

    Having a JSFiddle helps us in figuring out the issue and many a time we can just edit your code on JSFiddle to fix the issue right away.

    ___________
    Indranil Deo
    Team CanvasJS

    #30607

    its something like this:

    JS Fiddle

    Check this example. in this example its showing 97% at most. but in my Actual example its showing 89% at most.

    • This reply was modified 3 years, 8 months ago by saqib.
    #30611

    @saqib,

    Labels are shown at every interval on the axis. As you are setting the maximum for axis we suggest you to set the interval along with it as shown in this JSFiddle.

    ___________
    Indranil Deo
    Team CanvasJS

    #30619

    it Worked. Thanks a lot for this library.

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

You must be logged in to reply to this topic.