highcharts - How to add border in polygon plot? -
i plotting polygon series using highcharts cannot add border it. tried use plotoptions.series.borderwidth no effect.
code:
$(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' } }); });
how can add plot polygon series?
you can set line-width show border around polygon using :
plotoptions: { series: { linewidth: 3 //whatever width want } }
see fiddle code here
if want set different color in border of polygon use :
plotoptions: { series: { linewidth: 3, linecolor:'#ff9634' // whatever border color want } }
see different border color on code here
Comments
Post a Comment