Highcharts -创建指定默认系列标记属性集的主题

oo7oh9g9  于 9个月前  发布在  Highcharts
关注(0)|答案(1)|浏览(86)

我可以轻松地创建一个主题,定义每个系列使用的颜色集:

Highcharts.setOptions({
    colors: ['red', 'green', 'blue']
})

但是如何定义一组标记属性,如symboldashStyle,以用于每个系列呢?
我在Highcharts网站上找不到任何关于这方面的描述,他们的ChatGPT解决方案提供的解决方案也不起作用。

q7solyqu

q7solyqu1#

您可以在Highcharts.setOptions()中使用plotOptions来设置特定的标记符号和破折号样式。

Highcharts.setOptions({
    colors: ['red', 'green', 'blue'],
    plotOptions: {
        series: {
            dashStyle: 'Dash',
            marker: {
                symbol: 'square',
            }
        }
    }
})

Demohttps://jsfiddle.net/BlackLabel/6L1x43k2/
APIhttps://api.highcharts.com/highcharts/plotOptions.series.marker

另一个选项是,如果你想设置不同的符号顺序,你可以使用符号的属性:

Highcharts.setOptions({
  symbols:["square", "triangle-down", "circle"]
});

Demohttps://jsfiddle.net/BlackLabel/5y38jenx/

相关问题