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

TooltipsAppearance - Show NameField

3 Answers 238 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 12 Apr 2013, 08:14 PM
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>

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 16 Apr 2013, 01:22 PM
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.
0
Tim
Top achievements
Rank 1
answered on 16 Apr 2013, 02:13 PM
Thanks for the help. I think it would be helpful to add this more prominently in the documentation under Appearance & Styling.

Tim
0
Danail Vasilev
Telerik team
answered on 19 Apr 2013, 09:56 AM
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.
Tags
Chart (Obsolete)
Asked by
Tim
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Tim
Top achievements
Rank 1
Share this question
or