我正在使用EXTJS 7.3.1处理面积图,我希望能够根据数据值自定义标记颜色。
我怎么能做到这一点。
目前,标记是为整个图表设置的。像这样。enter image description here
我希望当值小于75时更改标记上的颜色
请让我知道
发布于 2021-07-25 20:33:33
您需要为该系列创建自定义渲染器函数see here in the documentation。
如下所示:
series: [{
// your series definition, including marker etc.
,renderer: function(sprite, config, rendererData, index) {
// renderer function must return the changes
var changes = {};
// get current record in the chart's store
var record = rendererData.store.getData().items[index];
// check value only when it is a marker
if (config.type === 'marker') {
// replace 'fieldName' with your fieldname
// and color1 color2 with the desired colors
changes.fillStyle = record.data.fieldName < 75 ?
'color1' : 'color2';
}
return changes;
}
}],https://stackoverflow.com/questions/68497740
复制相似问题