Help with ChartJS in web forms -Custom Ticks in y axis values

Kalpana 291 Reputation points
2021-06-03T01:57:32.007+00:00

Hi

I have 2 y axis on my chart. I need the right side of the y axis to have custom values such as ( 2000, 4000, 5000, 55000)

I am trying to replicate an example from this site, https://jsfiddle.net/9a0cfae0/3/

But I am not getting those scales. Here is the script.

I need help with the y1 axes.
101800-barchartajax.txt

Developer technologies ASP.NET Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,096 Reputation points
    2021-06-03T06:45:59.21+00:00

    Hi @Kalpana ,
    As far as I think,you have wrong with the format of two yaxis. You need do like this:

        scales: {  
                    yAxes: [{  
                                id: 'y',  
                                type: 'linear',  
                                position: 'left',  
                                beginAtZero: true,  
                            }, {  
                                id: 'y1',  
                                type: 'linear',  
                                position: 'right',  
                                ticks: {  
                                    max: 10000000,  
                                    min: 0  
                                }  
                            }]  
                   }  
    

    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.