【问题标题】:Define yAxis value with two different yAxis scale highcharts使用两个不同的 yAxis 比例高图定义 yAxis 值
【发布时间】:2015-04-13 18:42:35
【问题描述】:

您好,我有一个带有 Highcharts 的图表,它是一个带有两个不同 yAxis 的折线图。 左边一图形%,右边一分钟。 我想将左侧“硬编码”为“0%、20%、40%、60%、80%、100%”

这是我的代码

   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

         }
     ]
 };

如何定义第一个 yAxis 比例并离开第二个动态?

非常感谢

【问题讨论】:

标签: javascript graphics highcharts highstock


【解决方案1】:

您应该将alignTicks 设置为false

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-22
    • 1970-01-01
    • 2017-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多