【问题标题】:Disabling highcharts stacked bar's highlight禁用 highcharts 堆叠条的突出显示
【发布时间】:2022-02-15 18:22:03
【问题描述】:

我正在尝试使用 Highcharts 堆积条形图。我有两个系列来创建如下图的褪色效果。

但是当我使用堆叠条时,它会突出显示这两个系列,就像这样。

我想要做的是禁用高光,这样我就可以获得我想要的淡入淡出效果。到目前为止,我尝试使用hover enable:falseinactive:true 禁用,但没有任何效果...顺便说一句,当我只使用一个系列时,我可以使用这两个选项禁用它。 这是我的文件。

var options = {
    chart: {
        renderTo: 'graph',
        type: 'bar',
        styledMode: true,
    },
    
    title: {
        text: ''
    },
    
    xAxis: { //actually y axis adds more variable in y axis
        categories: ['Lisansüstü', 'Lisans', 'Önlisans']
    },
    
    yAxis: {
        title: {
            text: ''
        },
        labels: {
            overflow: 'justify'
        },
    },
    
    tooltip:{
        enabled: false
    },
    
    credits: {
        enabled: false
    },
    
    plotOptions:{
        series:{
            stacking: 'normal',
            states: {
                hover: {
                  enabled: false,
                }
              }
        }
    },
   
    series: [{
        name: '',
        data: [5, 3, 4]
      }, {
        name: '',
        data: [2, 2, 3]
      },
]

};


var chart1 = new Highcharts.Chart(options);
  .highcharts-color-0 {
    fill: rgba(10, 89, 114, 0.5);
  }
   .highcharts-color-1 {
    fill: rgba(10, 89, 114, 0.2);
  }
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="graph" style="width:100%; height:100%;"></div>

【问题讨论】:

    标签: javascript html css highcharts


    【解决方案1】:
        plotOptions:{
        series:{
            stacking: 'normal',
            enableMouseTracking: false,
        }
    },
    

    在我搜索了这么久之后,发布此问题后 3 分钟解决了问题...这很好!

    【讨论】:

      猜你喜欢
      • 2018-10-03
      • 1970-01-01
      • 2014-04-04
      • 1970-01-01
      • 1970-01-01
      • 2021-11-16
      • 1970-01-01
      • 2017-07-28
      • 1970-01-01
      相关资源
      最近更新 更多