Not a question, but a discovery that I didn't see documented...
I wanted to add a custom tooltip to my sparkline column chart. However, I kept getting duplicate series values showing in the tooltip. (See the image "sparkline-tooltip-series.jpg.)" It seems that the series value is displayed in addition to whatever you put in the template if the template is added to the Series. Here is the code behind the example in the image:
To avoid this extra appearance of the series value, you have to use a shared template and put it in the PlotArea (not the Series). Code example for sparkline-tooltip-shared.jpg:
I wanted to add a custom tooltip to my sparkline column chart. However, I kept getting duplicate series values showing in the tooltip. (See the image "sparkline-tooltip-series.jpg.)" It seems that the series value is displayed in addition to whatever you put in the template if the template is added to the Series. Here is the code behind the example in the image:
<
telerik:RadHtmlChart
runat
=
"server"
ID
=
"rhcSol"
Layout
=
"Sparkline"
Width
=
"150px"
Height
=
"40px"
>
<
PlotArea
>
<
Series
>
<
telerik:ColumnSeries
DataFieldY
=
"cxCount"
>
<
Appearance
FillStyle-BackgroundColor
=
"Red"
></
Appearance
>
<
TooltipsAppearance
>
<
ClientTemplate
><
div
style
=
"color:white;"
>Sol #= category #</
div
>
<
div
> #= value #</
div
>
</
ClientTemplate
>
</
TooltipsAppearance
>
</
telerik:ColumnSeries
>
</
Series
>
<
XAxis
DataLabelsField
=
"sol"
></
XAxis
>
</
PlotArea
>
<
Legend
>
<
Appearance
Visible
=
"false"
></
Appearance
>
</
Legend
>
</
telerik:RadHtmlChart
>
To avoid this extra appearance of the series value, you have to use a shared template and put it in the PlotArea (not the Series). Code example for sparkline-tooltip-shared.jpg:
<
telerik:RadHtmlChart
runat
=
"server"
ID
=
"rhcSol"
Layout
=
"Sparkline"
Width
=
"150px"
Height
=
"40px"
>
<
PlotArea
>
<
CommonTooltipsAppearance
Shared
=
"true"
Visible
=
"true"
>
<
SharedTemplate
><
div
style
=
"color:white;"
>Sol #= category #</
div
>
<
div
style
=
"text-align:right;"
> #= points[i].value #</
div
>
</
SharedTemplate
>
</
CommonTooltipsAppearance
>
<
Series
>
<
telerik:ColumnSeries
DataFieldY
=
"cxCount"
>
<
Appearance
FillStyle-BackgroundColor
=
"Red"
></
Appearance
>
<
TooltipsAppearance
>
</
TooltipsAppearance
>
</
telerik:ColumnSeries
>
</
Series
>
<
XAxis
DataLabelsField
=
"sol"
></
XAxis
>
</
PlotArea
>
<
Legend
>
<
Appearance
Visible
=
"false"
></
Appearance
>
</
Legend
>
</
telerik:RadHtmlChart
>