首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更改悬停点上标记的颜色-高亮显示

更改悬停点上标记的颜色-高亮显示
EN

Stack Overflow用户
提问于 2021-07-14 16:13:54
回答 1查看 24关注 0票数 0

当鼠标悬停在图表上时,“标记”是一个圆形的灰色圆圈--我想将其更改为绿色的圆形圆圈。

当前图表http://jsfiddle.net/uqjvdtx2/3/

代码语言:javascript
复制
{
"title": {
    "text": "Jun 15, 2021",
    "style": {
        "fontWeight": "bold"
    }
},
"lang": {
    "noData": "Your custom message"
},
"legend": {
    "enabled": false
},
"xAxis": {
    "categories": [],
    "crosshair": {
        "width": 1,
        "zIndex": 2,
        "color": "#ccc"
    },
    "title": {
        "text": "test"
    },
    "visible": true,
    "labels": {
        "enabled": false
    }
},
"chart": {
    "height": 200
},
"yAxis": {
    "title": false,
    "crosshair": false
},
"credits": {
    "enabled": false
},
"tooltip": {
    "enabled": true,
    "backgroundColor": "#fff",
    "borderColor": "#ddd",
    "borderRadius": 0,
    "borderWidth": 0,
    "shadow": false,
    "shared": false,
    "useHTML": true,
    "zIndex": 99999
},
"plotOptions": {
    "area": {
        "marker": {
            "enabled": true,
            "symbol": "circle",
            "fillColor": "green",
            "radius": 2,
            "states": {
                "hover": {
                    "enabled": true,
                    "fillColor": "green"
                }
            }
        }
    }
},
"series": [
    {
        "name": "",
        "data": [
            72.61,
            61.66,
            62.48,
            62.22,
            55.29,
            59.15,
            63.91,
            61.05,
            60.12,
            60.84,
            60.96,
            53.72,
            56.31,
            63.41,
            62.25
        ],
       
        "color": "#ccc",
        "events": {}
    }
]

}enter code here

当鼠标悬停在图表上时,“标记”是一个圆形的灰色圆圈--我想将其更改为绿色的圆形圆圈。

EN

回答 1

Stack Overflow用户

发布于 2021-07-14 17:14:01

您为面积系列定义了标记选项,并使用了线系列。更正选项结构,并针对每个州使用单独的选项。

代码语言:javascript
复制
 plotOptions: {
   line: {
     marker: {
       states: {
         hover: {
           fillColor: 'green'
         },
         normal: { ... }
       }
     }
   }
 }

现场演示: http://jsfiddle.net/BlackLabel/er7fnkh0/

接口参考: https://api.highcharts.com/highcharts/plotOptions.line.marker.states.hover

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68374378

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档