简体   繁体   English

使用两个不同的yAxis比例高图定义yAxis值

[英]Define yAxis value with two different yAxis scale highcharts

Hello I have a chart with Highcharts, it's a line chart with two different yAxis. 您好,我有一个带有Highcharts的图表,它是带有两个不同yAxis的折线图。 The left one graphics % and the right one minutes. 左一图形%,右一分钟。 I want to "hardcode" the left to be in this scale "0%, 20%, 40%, 60%, 80%, 100%" 我想“编码”左边的比例尺为“ 0%,20%,40%,60%,80%,100%”

This is my code 这是我的代码

   var chartTot = {
     chart: {
         renderTo: 'grafTot',
         type: 'line',
         marginBottom: 110,

     },
     legend: {
         itemDistance: 20,
         itemWidth: 190
     },

     title: {
         text: ''
     },
     plotOptions: {
         series: {
             marker: {
                 enabled: false
             }
         }
     },
     xAxis: {
         categories: $scope.hours
     },
     yAxis: [{ //1st yAxis
             title: {
                 text: 'Clients %'
             },
             min: 0, // I want my graphic 0 to 100 but with this i get 
             max: 100, // 0- 120 because of the second axis 
             labels: {
                 format: '{value} %',
             },
         },



         { //2nd yAxis
             title: {
                 text: 'Minutes'
             },
             min: 0,
             max: 60,
             labels: {
                 format: '{value} min',
                 style: {
                     color: Highcharts.getOptions().colors[6]
                 }
             },
             opposite: true

         }
     ]
 };

How can I define the 1st yAxis scale and left the 2nd dynamic? 如何定义第一个yAxis比例并保留第二个动态?

Thanks a lot 非常感谢

您应该将AlignTicks设置为false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM