New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Client Templates for Labels and Tooltips

As of Q3 2012 the RadHtmlChart offers client-side templates for the labels and tooltips used in the series. This property allows for runtime evaluation of the dataItem object associated with each series item. This means that additional columns from the data source can be displayed as the content instead of only a string formatted around the value. The property that controls this is ClientTemplate and is exposed in the LabelsAppearance and TooltipsAppearance tags for each series.

You can learn more about client templates in RadHtmlChart in our documentation—Client Templates Overview.

As of Q2 2016, client-side templates are also available for the YAxis and XAxis labels, and for the Legend items. Specifics about Legend's and Axes' client templates configuration is available in the Using Client Templates in Legend and Axes Labels article.

  • DefaultVB.aspx
<%@ Page Language="vb"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-wide">
        <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" DataSourceID="SqlDataSource1">
                    <telerik:BarSeries DataFieldY="Price">
                            <ClientTemplate>#=dataItem.ProductName# ($#=dataItem.Price#)</ClientTemplate>
                        <TooltipsAppearance Color="White">
                            <ClientTemplate>#=dataItem.ProductName#<br />#=dataItem.Manufacturer#</ClientTemplate>
                <XAxis DataLabelsField="ProductName">
                        <ClientTemplate>#=value# \n #if (value < 1000) {# low #} else if(value == 1000) {# good #} else {# high #}# \n price</ClientTemplate>
                    <ClientTemplate>Products by Price \n (#= # items) </ClientTemplate>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
        SelectCommand="SELECT [ProductName], [Manufacturer], [Price] FROM [Products]"></asp:SqlDataSource>

Support & Learning Resources

Find Assistance