This question is locked. New answers and comments are not allowed.
Hi
I have a problem about Multiple Y axes with different color. I use seriesMapping to bind data, and the DataSource is not static. I want to give each seriesMapping an Y axes . I want to set Y axes color same with series color. For example, the second series color is red, I want to set the second Y axes color red too.
I have read the example or topic about Multiple Y axes. In the topic , the colors have been set. I may have much more seriesMapping and Y axes , I can not set each of them by myself, so I want to get the color of series to give Y axes. How can I do that? Here is my code.
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "First";
seriesMapping.ItemMappings.Add(new ItemMapping("name1", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("value1", DataPointMember.YValue));
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
radChart.SeriesMappings.Add(seriesMapping);
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "Second";
seriesMapping.ItemMappings.Add(new ItemMapping("name2", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("value2", DataPointMember.YValue));
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
AxisY axisY2 = new AxisY();
axisY2.AxisName = "Second";
radChart.DefaultView.ChartArea.AdditionalYAxes.Add(axisY2);
seriesMapping.SeriesDefinition.AxisName = "Second";
radChart.SeriesMappings.Add(seriesMapping);
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "Third";
seriesMapping.ItemMappings.Add(new ItemMapping("name3", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("value3", DataPointMember.YValue));
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
AxisY axisY3 = new AxisY();
axisY3.AxisName = "Third";
radChart.DefaultView.ChartArea.AdditionalYAxes.Add(axisY3);
seriesMapping.SeriesDefinition.AxisName = "Second";
radChart.SeriesMappings.Add(seriesMapping);
........a lot of seriesMapping and Y axes . But these Y axes have the same color(black), I want to show different colors, and the series and Y axes are the same color.
Thanks in advance.
I have a problem about Multiple Y axes with different color. I use seriesMapping to bind data, and the DataSource is not static. I want to give each seriesMapping an Y axes . I want to set Y axes color same with series color. For example, the second series color is red, I want to set the second Y axes color red too.
I have read the example or topic about Multiple Y axes. In the topic , the colors have been set. I may have much more seriesMapping and Y axes , I can not set each of them by myself, so I want to get the color of series to give Y axes. How can I do that? Here is my code.
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "First";
seriesMapping.ItemMappings.Add(new ItemMapping("name1", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("value1", DataPointMember.YValue));
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
radChart.SeriesMappings.Add(seriesMapping);
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "Second";
seriesMapping.ItemMappings.Add(new ItemMapping("name2", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("value2", DataPointMember.YValue));
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
AxisY axisY2 = new AxisY();
axisY2.AxisName = "Second";
radChart.DefaultView.ChartArea.AdditionalYAxes.Add(axisY2);
seriesMapping.SeriesDefinition.AxisName = "Second";
radChart.SeriesMappings.Add(seriesMapping);
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "Third";
seriesMapping.ItemMappings.Add(new ItemMapping("name3", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("value3", DataPointMember.YValue));
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
AxisY axisY3 = new AxisY();
axisY3.AxisName = "Third";
radChart.DefaultView.ChartArea.AdditionalYAxes.Add(axisY3);
seriesMapping.SeriesDefinition.AxisName = "Second";
radChart.SeriesMappings.Add(seriesMapping);
........a lot of seriesMapping and Y axes . But these Y axes have the same color(black), I want to show different colors, and the series and Y axes are the same color.
Thanks in advance.