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

How to correctly display TooltipsAppearance labels on donut chart

3 Answers 273 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Arturo
Top achievements
Rank 1
Arturo asked on 01 Jun 2020, 04:53 PM

Hello again, I have a problem showing information in TooltipsAppearance tags, inside clientTemplate.

On line 18, I have tried the following ways:

Valor: #=dataItem.Porcentaje#

Valor: #:dataItem.Porcentaje#

Valor: #=series.Porcentaje#

Valor: #:series.Porcentaje#

 

And I just get to show "undefined"

Somebody could help me? Thanks

The HTML code:

 

01.<telerik:RadHtmlChart ID="rChartSolXTipo" runat="server" Transitions="true" Skin="Silk">
02.<Appearance>
03.<FillStyle BackgroundColor="White"></FillStyle>
04.</Appearance>
05.<ChartTitle Text="Solicitudes por tipo">
06.<Appearance Align="Center" Position="Top"></Appearance>
07.</ChartTitle>
08.<Legend>
09.<Appearance Position="Right" Visible="true">
10.</Appearance>
11.</Legend>
12.<PlotArea>
13.<Series>
14.<telerik:DonutSeries StartAngle="90"  HoleSize="65" DataFieldY="Porcentaje" NameField="TipoSol">
15.<LabelsAppearance Position="Center" DataFormatString="{0}%" Visible="True"></LabelsAppearance>
16.<TooltipsAppearance Color="White">
17.<ClientTemplate>                                                           
18.                 Valor: #=dataItem.Porcentaje#
19.</ClientTemplate>
20.</TooltipsAppearance>
21.</telerik:DonutSeries>
22.</Series>
23.</PlotArea>
24.</telerik:RadHtmlChart>

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 04 Jun 2020, 08:43 AM

Hi Arturo,

Both of the "dataItem" options can be used for accessing the value of a databound chart, including the "value" field itself. I am attaching a page with some sample data bound to the chart where the tooltip values are accessed properly, so you can examine it and compare it with your actual setup at your end.

I am using the latest 2020.2 512 version of the controls.

Regards,
Vessy
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Arturo
Top achievements
Rank 1
answered on 04 Jun 2020, 03:35 PM

Hi Vessy, it works when I changed the way to set the datasource, this was my code:

 For Each fila As DataRow In dtSols.Rows
                serieItem = New SeriesItem
                serieItem.Name = fila("TipoSol").ToString
                serieItem.YValue = fila("Porcentaje").ToString
                rChartSolXTipo.PlotArea.Series(0).Items.Add(serieItem)
 Next

 

Now I use:

 rChartSolXTipo.DataSource = daoSols.GetTable()
 rChartSolXTipo.DataBind()

 

 

Thanks!!!

 

 

 

0
Vessy
Telerik team
answered on 05 Jun 2020, 05:11 AM

Hi,

You are welcome, Arturo! I am glad my reply was helpful in resolving the issue :)

Regards,
Vessy
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Chart (HTML5)
Asked by
Arturo
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Arturo
Top achievements
Rank 1
Share this question
or