停止HighCharts增加悬停线的宽度 [英] Stop HighCharts increasing width of line on hover

查看:101
本文介绍了停止HighCharts增加悬停线的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新版本的HighCharts来构建具有多种趋势的图表。默认情况下,当用户的鼠标悬停在线上时,HighCharts会增加线条的粗细/线宽。因为我可以在图表上有~10个趋势,我想删除此功能,这意味着线条的粗细在悬停时不会改变。








case make lineWidth:1 for hover

  plotOptions:{
series:{
lineWidth:2,
表示:{
悬停:{
lineWidth:1
}
}

DEMO 2


I am using the latest version of HighCharts to build a chart with multiple trends. By default HighCharts increases the thickness / lineWidth of a line when the user's mouse hovers over it. Because I could have ~10 trends on the chart I would like to remove this feature, meaning that the thickness of the line does not change on hover.

jsFiddle of code so far

I believe I need to set this in the plotOptions{} section. I have tried adding the following without success:

plotOptions: {
    series: {
        mouseOver: {
            lineWidth: 2
        }
    },
    marker: {
        enabled: false,
        states: {
            hover: {
                lineWidth: 2
            }
        }
    }
},

I would, however, like to retain the marker that denotes where the mouse of positioned:

解决方案

Make this below change (Set the states mouseover to disabled state)

plotOptions: {
            series: {
                    lineWidth: 2,
                 states: {
                    hover: {
                        enabled: false
                    }
                }
            },

DEMO


In that case make lineWidth: 1 for hover

plotOptions: {
            series: {
                    lineWidth: 2,
                 states: {
                    hover: {
                        lineWidth: 1
                    }
                }

DEMO 2

这篇关于停止HighCharts增加悬停线的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆