Hi,
I create my chart in code behind, I do not use seriesMapping, I add dataseries to my chart like this:
/// <summary>
/// Add dataseries to chart
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="chart"></param>
/// <param name="seriesDef"></param>
/// <param name="data"></param>
public static void CreateDataSeries<T>(this RadChart chart, CustomSeriesDefinition<T> seriesDef, IEnumerable<T> data)
{
//if already there, do nothing
if (chart.DefaultView.ChartArea.DataSeries.Any(s => s.LegendLabel == seriesDef.LegendLabel))
return;
var dataSeries = ChartGenerator.CreateDefaultDataSeries(seriesDef);
if (seriesDef.IsVisableInLegend)
dataSeries.LegendLabel = seriesDef.LegendLabel;
foreach (var dataElement in data)
{
var point = seriesDef.Compute(dataElement);
dataSeries.Add(point);
}
chart.DefaultView.ChartArea.DataSeries.Add(dataSeries);
}
and the CustomSeriesDefinition is defined here
public CustomSeriesDefinition(string legendLabel, SeriesDefinition chartType, Func<T, DataPoint> compute, bool isVisableInLegend, bool showItemToolTips = false)
{
ChartType = chartType;
ChartType.ShowItemToolTips = showItemToolTips;
Compute = compute;
IsVisableInLegend = isVisableInLegend;
LegendLabel = legendLabel;
}
When I set the ShowItemToolTip = true, I never get the event firing for ItemToolTipOpening. Do I have to use SeriesMapping to use this event?
I create my chart in code behind, I do not use seriesMapping, I add dataseries to my chart like this:
/// <summary>
/// Add dataseries to chart
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="chart"></param>
/// <param name="seriesDef"></param>
/// <param name="data"></param>
public static void CreateDataSeries<T>(this RadChart chart, CustomSeriesDefinition<T> seriesDef, IEnumerable<T> data)
{
//if already there, do nothing
if (chart.DefaultView.ChartArea.DataSeries.Any(s => s.LegendLabel == seriesDef.LegendLabel))
return;
var dataSeries = ChartGenerator.CreateDefaultDataSeries(seriesDef);
if (seriesDef.IsVisableInLegend)
dataSeries.LegendLabel = seriesDef.LegendLabel;
foreach (var dataElement in data)
{
var point = seriesDef.Compute(dataElement);
dataSeries.Add(point);
}
chart.DefaultView.ChartArea.DataSeries.Add(dataSeries);
}
and the CustomSeriesDefinition is defined here
public CustomSeriesDefinition(string legendLabel, SeriesDefinition chartType, Func<T, DataPoint> compute, bool isVisableInLegend, bool showItemToolTips = false)
{
ChartType = chartType;
ChartType.ShowItemToolTips = showItemToolTips;
Compute = compute;
IsVisableInLegend = isVisableInLegend;
LegendLabel = legendLabel;
}
When I set the ShowItemToolTip = true, I never get the event firing for ItemToolTipOpening. Do I have to use SeriesMapping to use this event?