是否有任何简单的方法来自定义 Highcharts 呈现线条的方式?
我不是在谈论颜色或(API 的一部分),而是像 stroke-linejoin 或 stroke-linecap 这样的东西。
基本上,我想将值从“round”更改为“mitel”。
最佳答案
简而言之,不支持。但是,您可以通过包装 drawGraph
方法来实现,例如:
var H = Highcharts;
H.wrap(H.seriesTypes.line.prototype, 'drawGraph', function (p) {
var series = this,
options = this.options,
props = [
['graph', options.lineColor || this.color]
];
p.call(series);
H.each(props, function (prop, i) {
var graphKey = prop[0],
graph = series[graphKey];
if (graph) {
graph.attr({
'stroke-linejoin': 'round',
'stroke-linecap': 'square'
})
}
});
});
关于javascript - 在 Highcharts 中更改 SVG 描边选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26275615/