TooltipsAppearance - Show NameField

Thread is closed for posting
4 posts, 0 answers
  1. Tim
    Tim avatar
    39 posts
    Member since:
    Oct 2010

    Posted 12 Apr 2013 Link to this post

    Is it possible to display the NameField value in the Tooltip on a RadHtmlChart?

    On mouse over I want it to show: "ABC County: 50".

    Thanks

       
    <telerik:RadHtmlChart runat="server" ID="CaseCountyPieChart" Width="300"
            DataSourceID="CaseCountyByDateRangeLinqDataSource" Transitions="true">
        <Appearance>
            <FillStyle BackgroundColor="White"></FillStyle>
        </Appearance>
        <ChartTitle Text="Cases by Case County">
            <Appearance Align="Center" BackgroundColor="White" Position="Top"></Appearance>
        </ChartTitle>
        <Legend>
            <Appearance BackgroundColor="White" Position="Bottom" Visible="true" />
        </Legend>
        <PlotArea>
            <Appearance>
                <FillStyle BackgroundColor="White"></FillStyle>
            </Appearance>
             
            <Series>
                <telerik:PieSeries NameField="county" DataFieldY="caseCount" StartAngle="90">
                    <LabelsAppearance Position="Circle" DataFormatString="{0}" />
                    <TooltipsAppearance DataFormatString=" NameField Here:  {0}" />                       
                </telerik:PieSeries>
            </Series>
        </PlotArea>
    </telerik:RadHtmlChart>
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 16 Apr 2013 Link to this post

    Hi Tim,

    You can use the ClientTemplate functionality of the RadHtmlChart, in order to populate values for tooltips from columns inside a datasource which is databound to the chart itself. For example:
    <telerik:PieSeries NameField="county" DataFieldY="caseCount" StartAngle="90">
         <LabelsAppearance Position="Circle" DataFormatString="{0}" />
         <TooltipsAppearance ClientTemplate="#=dataItem.county#: #=dataItem.caseCount#"/>                      
     </telerik:PieSeries>
    where the highlighter text are the datasource columns which will be used for the tooltips. You can also find useful the HtmlChart - Client Templates for Series Labels and Tooltips online demo.

    On a side note - your question is related to the RadHtmlChart rather than the RadChart, so make sure to set the proper product category when you open forum threads.

    All the best,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tim
    Tim avatar
    39 posts
    Member since:
    Oct 2010

    Posted 16 Apr 2013 Link to this post

    Thanks for the help. I think it would be helpful to add this more prominently in the documentation under Appearance & Styling.

    Tim
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 19 Apr 2013 Link to this post

    Hi Tim,

    Thank you for your suggestion.

    The reason why the ClientTemplate functionality is not put under Appearance & Styling section is that the mentioned section is related to modifying the visual appearance of certain elements from the control. For example, if the ClientTemplates had the ability to control the color, font or padding this section would have been the right place.

    In the current case, however, the ClientTemplates is a functionality that lets you load data for the tooltips and labels from a datasource and that is why it has been placed under functionality section.

    Greetings,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top