可以强制Highcarts对折线图中的所有系列使用圆形符号
Possible to force Highcarts to use the circle symbol for all the series in a line graph?
我希望所有的线都使用相同的圆形符号。
这是我目前拥有的:
$TopChartJS = $(function () {
var chart = new Highcharts.Chart({
colors: ["#cc1c0d", "#1d63af" , "#9eb215"],
chart: {
type: 'line',
backgroundColor:'rgba(255, 255, 255, 0.85)',
renderTo: 'container'
},
data: {
table: 'sheet6'
},
title: {
text: 'Cost Comparison'
},
xAxis: {
tickInterval:3,
title: {
text: 'Months'
},
},
plotOptions: {
series: {
marker: {
radius: 3,
fillColor: '#FFFFFF',
lineWidth: 2,
lineColor: null // inherit from series
},
shadow: true
}
},
yAxis: {
allowDecimals: false,
title: {
text: 'Cost [kUSD]'
},
labels: {
formatter: function () {
return Highcharts.numberFormat(this.value,0);
}
}
},
credits: {
enabled: false
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: 'Month {point.x}: {point.y} kUSD'
},
});
});
我的图表中有三个系列,我希望它们都使用相同的圆圈符号,但颜色不同。
我曾尝试将plottoptions标记符号定义添加到各个部分,但这似乎不起作用,图表也不再显示。
这可能吗?
是的,您可以将标记的绘图选项设置为圆形,它将用于所有系列。例如(JSFiddle):
$('#container').highcharts({
plotOptions: {
series: {
marker: {
symbol: 'circle'
}
}
},
series: [{
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
}, {
data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]
}, {
data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0]
}]
});
相关文章:
- 在.csv文件中写入学位符号
- 动态更改高图中的系列颜色
- 使用相同的数据集绘制各种符号
- Highcharts colorsByPoint与系列中的线性渐变一起使用时不起作用
- chart.series[id].remove()无法刷新高位图表/高位股票中其他系列的图例属性
- 将带点符号的属性(有时)传递给函数
- RegEx JavaScript:数字后的符号提取
- 如何在计算器符号为零时替换它
- 删除输入中输入的符号
- async.js和系列问题
- 如何在ReactJs中渲染重音符号
- 如何替换JavaScript字符串中除字母和数字之外的所有内容(空格/符号)
- 插入符号到底是什么
- 删除图形和数字之间的连字符(-)符号
- 浏览器intl.NumberFormat未正确显示货币符号
- JS toLocaleString始终显示货币符号,而不考虑区域设置
- 可以强制Highcarts对折线图中的所有系列使用圆形符号
- 在一个系列FlotJS上使用几个符号
- 高图:向倒排柱范围图系列添加符号
- 高图 - 1 个系列的不同符号