Highcharts 如何在多边形打印中添加边框?
我正在使用highcharts绘制多边形系列,但无法向其添加边框。我尝试使用plotOptions.series.borderWidth,但没有效果 代码:Highcharts 如何在多边形打印中添加边框?,highcharts,polygon,Highcharts,Polygon,我正在使用highcharts绘制多边形系列,但无法向其添加边框。我尝试使用plotOptions.series.borderWidth,但没有效果 代码: $(function () { $('#container').highcharts({ title: { text: 'Height vs Weight' }, subtitle: { text: 'Polygon series
$(function () {
$('#container').highcharts({
title: {
text: 'Height vs Weight'
},
subtitle: {
text: 'Polygon series in Highcharts'
},
xAxis: {
gridLineWidth: 1,
title: {
enabled: true,
text: 'Height (cm)'
},
startOnTick: true,
endOnTick: true,
showLastLabel: true
},
yAxis: {
title: {
text: 'Weight (kg)'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
series: [{
name: 'Target',
type: 'polygon',
data: [[153, 42], [149, 46], [149, 55], [152, 60], [159, 70], [170, 77], [180, 70],
[180, 60], [173, 52], [166, 45]],
color: Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0.5).get(),
enableMouseTracking: false
}],
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x} cm, {point.y} kg'
}
});
});
$(函数(){
$(“#容器”)。高图({
标题:{
文字:“身高与体重”
},
副标题:{
文字:“高图中的多边形系列”
},
xAxis:{
网格线宽度:1,
标题:{
启用:对,
文字:“高度(厘米)”
},
是的,
恩东蒂克:是的,
showLastLabel:true
},
亚克斯:{
标题:{
正文:“重量(kg)”
}
},
图例:{
布局:“垂直”,
对齐:“右”,
垂直排列:“中间”
},
系列:[{
名称:“目标”,
键入:“多边形”,
数据:[[153,42],[149,46],[149,55],[152,60],[159,70],[170,77],[180,70],
[180, 60], [173, 52], [166, 45]],
颜色:Highcharts.color(Highcharts.getOptions().colors[0]).setOpacity(0.5.get(),
enableMouseTracking:false
}],
工具提示:{
headerFormat:“{series.name}
”,
pointFormat:“{point.x}cm,{point.y}kg”
}
});
});
如何将打印添加到多边形系列?您可以使用以下方法设置线宽以显示多边形周围的边框:
plotOptions: {
series: {
lineWidth: 3 //whatever width you want
}
}
见
如果要在多边形的边界中设置不同的颜色,请使用:
plotOptions: {
series: {
lineWidth: 3,
lineColor:'#ff9634' // whatever border color you want
}
}
在屏幕上查看不同的边框颜色