以特定颜色呈现 Sencha 图表中的数据点
Render data points in a Sencha Chart in a specific color
我想根据商店中的值,以不同于其他颜色的颜色呈现图表中的某些数据点。我遇到的问题是,不仅标记以不同的颜色呈现,而且标记的线也呈现为不同的颜色,正如您在 fiddle 中看到的那样:https://fiddle.sencha.com/#fiddle/lmu
有没有办法只改变实际数据点的颜色?
提前致谢!
将您的渲染器函数更改为此 -
renderer: function (sprite, config, rendererData, index) {
var items = rendererData.store.getData().items;
if (items[index].data.hidden && config.type ==='marker') { // also check for config.type (data point will return marker as type and the lines will return line)
return { strokeStyle: 'yellow', lineWidth: 5 }; // added a lineWidth so that you can see the different color easily
}
}
我想根据商店中的值,以不同于其他颜色的颜色呈现图表中的某些数据点。我遇到的问题是,不仅标记以不同的颜色呈现,而且标记的线也呈现为不同的颜色,正如您在 fiddle 中看到的那样:https://fiddle.sencha.com/#fiddle/lmu
有没有办法只改变实际数据点的颜色?
提前致谢!
将您的渲染器函数更改为此 -
renderer: function (sprite, config, rendererData, index) {
var items = rendererData.store.getData().items;
if (items[index].data.hidden && config.type ==='marker') { // also check for config.type (data point will return marker as type and the lines will return line)
return { strokeStyle: 'yellow', lineWidth: 5 }; // added a lineWidth so that you can see the different color easily
}
}