View Full Version : [Chart] Series renderer problem.

6 Feb 2012, 5:54 AM
Hi, All!

I need to paint particular markers of some series into other color then defined in markerConfig option during series creation. So, according to help, I can use my own series renderer:

renderer (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.chart.series.Series-cfg-renderer) : Function (http://docs.sencha.com/ext-js/4-0/#!/api/Function)
A function that can be overridden to set custom styling properties to each rendered element. Passes in (sprite, record, attributes, index, store) to the function.

Series configuration:

title: displayName,
type: 'line',
axis: 'left',
xField: 'name',
yField: yField,
highlight: false,
showMarkers: true,
selectionTolerance: 3,
renderer: this.seriesRenderer

Series renderer:

seriesRenderer: function(sprite, record, attributes, index, store){
Ext.apply(attributes, {fill: "FF0000", stroke: "FF0000"});
return attributes;

Looks like attributes returned from my renderer does not work. I've tried to change style of sprite(marker) within renderer function, but this didn't help too:

seriesRenderer: function(sprite, record, attributes, index, store){
sprite.setAttributes({fill: "FF0000", stroke: "FF0000"}, true);
return attributes;

Does anybody know what is wrong? :-?

6 Feb 2012, 7:59 AM
What Ext JS 4 version are you using?

6 Feb 2012, 8:17 AM
I've tried this on 4.1 beta 1 and 2