This question is locked. New answers and comments are not allowed.
Hi,
I have successfully created a chart with a series , but cannot seem to get tooltips visible OR item click firing?
Here is the relevant code i use...
Many Thanks
Mark
I have successfully created a chart with a series , but cannot seem to get tooltips visible OR item click firing?
Here is the relevant code i use...
Many Thanks
Mark
| this.RadChart1.SeriesMappings.Add(seriesmapping); |
| this.RadChart1.DefaultView.ChartArea.ItemClick+=new EventHandler<ChartItemClickEventArgs>(ChartArea_ItemClick); |
|
this
.RadChart1.ItemsSource = ReturnChartData;
|
| private SeriesMapping seriesmapping() |
| { |
| SeriesMapping _seriesMapping = new SeriesMapping(); |
| _seriesMapping.SeriesDefinition = new BarSeriesDefinition(); |
| ItemMapping yMap = new ItemMapping("yValue0" , DataPointMember.YValue); |
| ItemMapping xMap = new ItemMapping("xCategory", DataPointMember.XCategory); |
| _seriesMapping.ItemMappings.Add(yMap); |
| _seriesMapping.ItemMappings.Add(xMap); |
| _seriesMapping.SeriesDefinition.ShowItemToolTips = true; |
| return _seriesMapping; |
| } |
| private void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e) |
| { |
| MessageBox.Show("asfafasfasfasfasfasfasf","my message", MessageBoxButton.OK); |
| } |
| private List<ChartData> ReturnChartData() |
| { |
| List<ChartData> data = new List<ChartData>(); |
| data.Add(new ChartData("Toyota", 125,10,100)); |
| data.Add(new ChartData("GM", 192, 20, 90)); |
| data.Add(new ChartData("VW", 151, 30, 80)); |
| data.Add(new ChartData("Ford", 125, 40, 70)); |
| data.Add(new ChartData("Honda", 154, 50, 60)); |
| data.Add(new ChartData("Nissan", 79, 30, 50)); |
| data.Add(new ChartData("PSA", 79, 20, 100)); |
| data.Add(new ChartData("Hyundai", 64, 10, 46)); |
| return data; |
| } |
| public class ChartData |
| { |
| public ChartData() |
| { |
| } |
| public ChartData(string _xCategory, int _yValue0, int _yValue1, int _yValue2) |
| { |
| this.xCategory = _xCategory; |
| this.yValue0 = _yValue0; |
| this.yValue1 = _yValue1; |
| this.yValue2 = _yValue2; |
| } |
| public ChartData(string _xCategory, int _yValue0, int _yValue1) |
| { |
| this.xCategory = _xCategory; |
| this.yValue0 = _yValue0; |
| this.yValue1 = _yValue1; |
| } |
| public ChartData(string _xCategory, int _yValue0 ) |
| { |
| this.xCategory = _xCategory; |
| this.yValue0 = _yValue0; |
| } |
| public string xCategory |
| { |
| get; |
| set; |
| } |
| public int yValue0 |
| { |
| get; |
| set; |
| } |
| public int yValue1 |
| { |
| get; |
| set; |
| } |
| public int yValue2 |
| { |
| get; |
| set; |
| } |
| } |