This is a migrated thread and some comments may be shown as answers.

chart label rendering change in 14Q1

5 Answers 141 Views
Charts
This is a migrated thread and some comments may be shown as answers.
NaveRonen
Top achievements
Rank 1
NaveRonen asked on 23 Mar 2014, 12:48 PM
in 13Q3, it was possible to write HTML/SVG into the field which holds the label and to yield

<text id="k10835" data-model-id="k10836" x="59" y="36" fill-opacity="1" style="font: 12px Arial,Helvetica,sans-serif; " fill="#232323">
<tspan class='seriesLabel' >the label</tspan>
</text>

i.e. wrap the content with a tspan and a class which can label be used for CSS selector

but now, it is rendered with a quotation mark:

<text id="k10835" data-model-id="k10836" x="59" y="36" fill-opacity="1" style="font: 12px Arial,Helvetica,sans-serif; " fill="#232323">
"<tspan class='seriesLabel' >the label</tspan>"
</text>

and the whole "<tspan...." text is shown



5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 24 Mar 2014, 01:27 PM
Hi,

We decided to encode the text content in order to produce valid markup for html entities such as "<". There are security (XSS) considerations as well.

What type of styling are you applying with the CSS class? Perhaps we can offer them as built-in options and make it compatible with VML/Canvas as well.

Regards,
T. Tsonev
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
NaveRonen
Top achievements
Rank 1
answered on 25 Mar 2014, 09:42 AM
I have used this ability in two ways,  
one which i've seen requested by others, is to change the cursor of specific labels to a pointer. the class allows for an easier css selector and can be applied to just the labels needed.

second usage, was to fix label cluter by setting different Y offset to alternating labels - see attached images of before/after


i don't see how the xss is relevant here as this is a code generated by me and not injected.  you may as well block grids from having a custom HTML cells, etc etc

is there any chance you can add a switch for this behavior in the upcoming bugfix version?
0
T. Tsonev
Telerik team
answered on 26 Mar 2014, 05:04 PM
Hi,

Given that the issue that we resolved was relatively minor, I'm going to roll back this change in internal builds and for the service pack.
Templates can be overriden to use "#: ... #" syntax if encoding is desired. Also, calling kendo.htmlEncode will encode user-supplied strings.

Note that the user-supplied markup will produce unexpected results in old IE (VML) and on Android 2.x (Canvas).  See Notes on rendering for details.

Regards,
T. Tsonev
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
jim
Top achievements
Rank 1
answered on 29 Jul 2014, 02:16 PM
Hi

This tspan solution work fine in term of style, but I seem not be able get an
axisLabelClick event while clicking it.

Do I miss anything obvious?

Thanks
0
T. Tsonev
Telerik team
answered on 31 Jul 2014, 08:16 AM
Hi,

We'll update the current code to handle this case.
An internal build with the fix will be available later today (v. 2014.2.731 and later).

Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
NaveRonen
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
NaveRonen
Top achievements
Rank 1
jim
Top achievements
Rank 1
Share this question
or