PDA

View Full Version : [CLOSED] Chart CategoryAxis



ddslogistics
Mar 16, 2012, 4:22 PM
Hi,

is it possible to use image instead text to render X Axe Labels or to render html

i tried to use the renderer but the html is encoded


<ext:CategoryAxis Position="Bottom" Fields="Name" Title="Month of the Year" >
<Label>
<Renderer Handler="return '<p>MyLabel</p>';" / >
</Label>
</ext:CategoryAxis>

Thx

Daniil
Mar 16, 2012, 5:37 PM
Hi,

Please ensure the code is wrapped in [CODE ] tags, see:
Forum Guidelines For Posting New Topics (http://forums.ext.net/showthread.php?3440)

ddslogistics
Mar 19, 2012, 8:21 AM
Hi,

That's ok.

Vladimir
Mar 19, 2012, 10:44 AM
Hi,

I don't think that SVG/VML support it, you casn use sprite attributes only
For example,


<Label Font="bold 16px Arial" Fill="#F00">
<Renderer Handler="return Ext.util.Format.number(value, '0,0');" />
</Label>

Daniil
Mar 19, 2012, 10:46 AM
Thanks for editing.




is it possible to use image instead text to render X Axe Labels or to render html

i tried to use the renderer but the html is encoded


<ext:CategoryAxis Position="Bottom" Fields="Name" Title="Month of the Year" >
<Label>
<Renderer Handler="return '<p>MyLabel</p>';" / >
</Label>
</ext:CategoryAxis>


Unfortunately, no, HTML tags are not supported.

Generally, a Chart is an SVG image. And Label is a piece of that SVG image. SVG can't contain common HTML inside.

An Axis Label is a Ext.draw.Sprite instance with the "text" type.
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.draw.Sprite

Daniil
Mar 19, 2012, 10:47 AM
you can use sprite attributes only

Here is the list of supported attributes.
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.chart.Label-cfg-label