Hi everyone,
I'm desperately trying to show a tooltip on a SplineSeriesDefinition, but it doesn't work. I've read the most of the related post but unluckily, I wasn't able to fix my problem. I have a DataSeries populated with several DataPoint. I tried to set the tooltip on every DataPoint, on the SplineSeriesDefinition and even on the SeriesMapping unsuccessfully. All that I want is a tooltip when mouse is over the curve. Please, I urgently need to fix this problem. Might someone help me, please?
Below there's the definition of the RadChart in my XAML code, and a piece of code of my CS file:
<telerik:RadChart Name="radChartCurva" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left" Grid.Row="0" />
foreach (DatosGrafica graf in media)
{
DataPoint dp = new DataPoint(graf.valorX, graf.ValorPunto);
dp.Tooltip = graf.ValorPunto.ToString();
seriesCurva.Add(dp);
seriesMedia.Add(new DataPoint(graf.valorX, graf.Media));
}
seriesCurva.LegendLabel = StringResources.curve;
seriesMedia.LegendLabel = StringResources.average;
SplineSeriesDefinition serieDef = new SplineSeriesDefinition();
SplineSeriesDefinition serieDef2 = new SplineSeriesDefinition();
serieDef.ShowItemLabels = false;
serieDef.ShowPointMarks = false;
serieDef.ShowItemToolTips = true;
serieDef2.ShowItemLabels = false;
serieDef2.ShowPointMarks = false;
serieDef2.ShowItemToolTips = true;
seriesCurva.Definition = serieDef;
seriesMedia.Definition = serieDef2;
SeriesMapping sm = new SeriesMapping();
sm.SeriesDefinition = serieDef;
sm.ItemMappings.Add(new ItemMapping("XValue",DataPointMember.XValue));
sm.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
this.radChartCurva.SeriesMappings.Add(sm);
this.radChartCurva.DefaultView.ChartArea.DataSeries.Add(seriesMedia);
this.radChartCurva.DefaultView.ChartArea.DataSeries.Add(seriesCurva);
What's wrong with my code?
Thanks in advance guys :-)
I'm desperately trying to show a tooltip on a SplineSeriesDefinition, but it doesn't work. I've read the most of the related post but unluckily, I wasn't able to fix my problem. I have a DataSeries populated with several DataPoint. I tried to set the tooltip on every DataPoint, on the SplineSeriesDefinition and even on the SeriesMapping unsuccessfully. All that I want is a tooltip when mouse is over the curve. Please, I urgently need to fix this problem. Might someone help me, please?
Below there's the definition of the RadChart in my XAML code, and a piece of code of my CS file:
<telerik:RadChart Name="radChartCurva" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left" Grid.Row="0" />
foreach (DatosGrafica graf in media)
{
DataPoint dp = new DataPoint(graf.valorX, graf.ValorPunto);
dp.Tooltip = graf.ValorPunto.ToString();
seriesCurva.Add(dp);
seriesMedia.Add(new DataPoint(graf.valorX, graf.Media));
}
seriesCurva.LegendLabel = StringResources.curve;
seriesMedia.LegendLabel = StringResources.average;
SplineSeriesDefinition serieDef = new SplineSeriesDefinition();
SplineSeriesDefinition serieDef2 = new SplineSeriesDefinition();
serieDef.ShowItemLabels = false;
serieDef.ShowPointMarks = false;
serieDef.ShowItemToolTips = true;
serieDef2.ShowItemLabels = false;
serieDef2.ShowPointMarks = false;
serieDef2.ShowItemToolTips = true;
seriesCurva.Definition = serieDef;
seriesMedia.Definition = serieDef2;
SeriesMapping sm = new SeriesMapping();
sm.SeriesDefinition = serieDef;
sm.ItemMappings.Add(new ItemMapping("XValue",DataPointMember.XValue));
sm.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
this.radChartCurva.SeriesMappings.Add(sm);
this.radChartCurva.DefaultView.ChartArea.DataSeries.Add(seriesMedia);
this.radChartCurva.DefaultView.ChartArea.DataSeries.Add(seriesCurva);
What's wrong with my code?
Thanks in advance guys :-)