PDA

View Full Version : How to display the same sprite from a chart legend inside a grid



adube
13 Feb 2013, 8:12 AM
Hi,

Summary

I use a chart and a grid to display some data. I would like to display the colour sprite shown in the legend for each record inside the grid as well. How can I do that ?

More details

Looking at the Ext.chart.LegendItem code, I see how the sprites are created, but they don't seem to be retrievable, nor 'clonable' from the Ext.draw.Sprite instances (aren't they?).

I'm thinking about a simple solution : find the colour create a new square sprite and use it in the grid. That would work for almost all series but Lines, where displaying the same type of sprite (line + point) would be really nice and consistent. To support this, I don't see any other option than copying the entire block that creates the sprites and manage that in my grid, which I'd like to avoid.

Any thoughts ? Anyone already accomplished something similar ?

Thanks a lot,

Alexandre