PDA

View Full Version : ExtJS Line chart marker shape



abhishek1191
2 Jun 2015, 1:59 AM
I am trying to render ExtJS Line chart markers as square but the shape is always circle. Below is my code :


renderer:function(sprite, record, attr, index,{returnExt.apply(attr,{ type:'square', size:4, fill:'#FFF'});}


I have sample implementation here : https://fiddle.sencha.com/#fiddle/nq4
Please help! Thanks in advance.

Gary Schlosberg
3 Jun 2015, 4:31 PM
Looks like it's a bug:
https://www.sencha.com/forum/showthread.php?143672

abhishek1191
4 Jun 2015, 5:24 AM
Thanks Gary!

It does look like a bug!
But the thread you mentioned is 3-4 years old. Isn't it fixed yet? I am using ExtJS 4.2.1. It should get fixed if it's a bug /:)

Gary Schlosberg
4 Jun 2015, 6:35 AM
Bug reports are prioritized by our developers based on numerous factors. I apologize that this one has taken so long to get to. I did add some notes to help get some attention to it. If you've considered upgrading, this is working in Ext JS 5:
https://fiddle.sencha.com/#fiddle/o23

abhishek1191
5 Jun 2015, 12:53 AM
Hi Gary,

Many Thanks for your efforts on this.
I would see if we can upgrade to ExtJS 5.

marcribe
28 Apr 2016, 9:01 AM
I know that this is an old thread, but here is my contribution to this problem:


Ext.override(Ext.chart.Shape, {
square: function (surface, opts) {
var x = opts.x - opts.radius;
var y = opts.y - opts.radius;
var r = opts.radius;
var w = r * 2;
return surface.add(Ext.apply({
type: 'path',
stroke: null,
path: "M".concat(x, y, "h", w, "v", w, "h", -w, "z")
}, opts));
}
});