Javascript 如何克服highcharts样条曲线中的系列线重叠
我用highcharts实现了一个趋势图,数据是通过json动态加载的。图表使用数据正确呈现,但序列线、数据标签和符号在给定的数据点处相互重叠。我如何克服这个问题 找到小提琴的链接-Javascript 如何克服highcharts样条曲线中的系列线重叠,javascript,highcharts,Javascript,Highcharts,我用highcharts实现了一个趋势图,数据是通过json动态加载的。图表使用数据正确呈现,但序列线、数据标签和符号在给定的数据点处相互重叠。我如何克服这个问题 找到小提琴的链接- 请发布你的代码如果你能添加你的代码,那就太好了,或者fiddle?看看吧,trendChartSeries是一个JSON对象,它是预先填充并存储为全局变量的。标记和标签包含在JSON对象中。您的代码不完整。请阅读。此外,您还可以尝试使用数据标签选项:查看fiddle以获得更清晰的代码。 function rend
请发布你的代码如果你能添加你的代码,那就太好了,或者fiddle?看看吧,trendChartSeries是一个JSON对象,它是预先填充并存储为全局变量的。标记和标签包含在JSON对象中。您的代码不完整。请阅读。此外,您还可以尝试使用数据标签选项:查看fiddle以获得更清晰的代码。
function renderTrendChart(){
$("#trendChartContainer").highcharts({
title: {
text: 'Indicator Vs Action Trend Chart',
x: -20
},
xAxis: {
categories: trendChartCategoies
},
yAxis: {
minRange: 1,
allowDecimals: false,
min: 0,
title: {
text: 'Cases Identified'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
plotOptions: {
series: {
pointPadding: 10,
groupPadding: 10,
cursor: 'pointer',
}
},
series: [{"name": "Pneumothorax", "data": [ { "y": 1, "marker": { "symbol": "text:" }, "dataLabels": { "x": -10, "y": -2, "enabled": true, "format": "2", "style": { "fontWeight": "bold", "fontSize": "12px" } } },{ "y": 2, "marker": { "symbol": "text:" }, "dataLabels": { "x": -10, "y": -2, "enabled": true, "format": "2", "style": { "fontWeight": "bold", "fontSize": "12px" } } } ], "id": "Pneumothorax" },{"name": "Respiratory", "data": [ 0,{ "y": 1, "marker": { "symbol": "text:" }, "dataLabels": { "x": -10, "y": -2, "enabled": true, "format": "1", "style": { "fontWeight": "bold", "fontSize": "12px" } } } ], "id": "Respiratory" },{"name": "Exsanguination", "data": [ 0,{ "y": 2, "marker": { "symbol": "text:" }, "dataLabels": { "x": -10, "y": -2, "enabled": true, "format": "3", "style": { "fontWeight": "bold", "fontSize": "12px" } } } ], "id": "Exsanguination" }]
});
}