This is a migrated thread and some comments may be shown as answers.
How to give tooltip in bar chart dynamically ?
1 Answer 72 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Aravind asked on 02 Jul 2013, 06:58 AM
  How to give tooltip in radhtml bar chart,i am plot bar chart dynamically,but default value is appear in tooltip if i mouse over in bars, below is my html code for bar chart
   <telerik:RadHtmlChart runat="server" ID="BarChart" Width="500px" Height="300px" Transitions="true" Skin="Forest">

                                                                                        <ChartTitle Text="DASHBOARD">
                                                                                            <Appearance Align="Center" BackgroundColor="White" Position="Top"></Appearance>
                                                                                            <Appearance BackgroundColor="White" Position="Bottom"></Appearance>
                                                                                                <FillStyle BackgroundColor="White"></FillStyle>
                                                                                            <XAxis AxisCrossingValue="0" Color="#b3b3b3" Reversed="false">

                                                                                            <YAxis AxisCrossingValue="0" Color="#b3b3b3">
                                                                                                <LabelsAppearance DataFormatString="{0}"></LabelsAppearance>



and my programatically plot code is 


                Dim yaxis As New BarSeries()
                Dim yaxis1 As New BarSeries()
                yaxis.Name = "Pages"
                yaxis1.Name = "Files"

   For Each row As DataRow In dt.Rows
                      BarChart.PlotArea.XAxis.Items.Add(Convert.ToDateTime(row(0)).ToString("dd MMM"))

                        If (row(1).ToString = "") Then
                            '  yaxis.TooltipsAppearance.DataFormatString = "{0} " + row(1) + " , {1} nnnnnnn"------here i try tooltip but bar chart value is appear ,i mean row(1) value is "6"
                        End If
                        If (row(2).ToString = "") Then
                      '  yaxis1.TooltipsAppearance.DataFormatString = "{0} " + row(1) + " , {1} nnnnnnn"---here i try tooltip but bar chart value is appear ,i mean row(2) value is "3"

                        End If

pls reply asap

1 Answer, 1 is accepted

Sort by
Danail Vasilev
Telerik team
answered on 03 Jul 2013, 01:15 PM
Hello Aravind,

The format set by the DataFormatString property from the TooltipsAppearance element is a common for the whole series and cannot be unique for series items within the same series. The exception is the Bubble Series which has a ToolTip property exposed by each series item, so that you can specify a tooltip programmatically for each series item.

What you can do, however, in order to specify different tooltips/labels for series items is to use the ClientTemplate functionality. For more information on how to use ClientTemplate for tooltips and labels please refer to this online demo as well as to this help article.

Note also the ClientTemplate functionality is available only for a databound chart. That means if your chart is created programmatically then you can recreate your current logic, so that instead of creating items programmatically create a datasource which can be bound to the chart.

Danail Vasilev
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 the blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question