This question is locked. New answers and comments are not allowed.
HI,,
now i m try to do the multiple y-Axis, and i have done that too, but i need to do the differentiate the bars in different color, each color represent Event type. but i want to set colors too.
1, Event type 1 = Blue color
2,Event type 2 = Green color
3,Event type 3 = Brown color,. etc...
my code:-
EventBarChart.DefaultView.ChartArea.AdditionalYAxes.Add(new AxisY());
EventBarChart.DefaultView.ChartArea.AdditionalYAxes.Add(new AxisY());
EventBarChart.DefaultView.ChartArea.AdditionalYAxes[0].AxisName = "EventValue";
EventBarChart.DefaultView.ChartArea.AdditionalYAxes[1].AxisName = "EventType";
EventBarChart.DefaultView.ChartLegend.Header = "Event Types";
this.EventBarChart.DefaultView.ChartLegend.LegendItemMarkerShape = MarkerShape.StarFiveRay;
List<int> legendlist = new List<int>();
foreach (var item in EventLoglst)
{
/* To create multiple data Series to bind the chart */
DataSeries seriesType = new DataSeries();
DataSeries seriesValue = new DataSeries();
seriesValue.Add(new DataPoint(item.Dates, item.EventValue));
legendlist.Add(item.EventType);
seriesValue.LegendLabel = "Event Type -" + item.EventType.ToString();
EventBarChart.DefaultView.ChartArea.DataSeries.Add(seriesValue);
}
its working properly but , i need to show the bar and legend labels ,
here with i have attached my chart, and another one is how i need the chart legend label.
Regards
M. Asiq Raja
now i m try to do the multiple y-Axis, and i have done that too, but i need to do the differentiate the bars in different color, each color represent Event type. but i want to set colors too.
1, Event type 1 = Blue color
2,Event type 2 = Green color
3,Event type 3 = Brown color,. etc...
my code:-
EventBarChart.DefaultView.ChartArea.AdditionalYAxes.Add(new AxisY());
EventBarChart.DefaultView.ChartArea.AdditionalYAxes.Add(new AxisY());
EventBarChart.DefaultView.ChartArea.AdditionalYAxes[0].AxisName = "EventValue";
EventBarChart.DefaultView.ChartArea.AdditionalYAxes[1].AxisName = "EventType";
EventBarChart.DefaultView.ChartLegend.Header = "Event Types";
this.EventBarChart.DefaultView.ChartLegend.LegendItemMarkerShape = MarkerShape.StarFiveRay;
List<int> legendlist = new List<int>();
foreach (var item in EventLoglst)
{
/* To create multiple data Series to bind the chart */
DataSeries seriesType = new DataSeries();
DataSeries seriesValue = new DataSeries();
seriesValue.Add(new DataPoint(item.Dates, item.EventValue));
legendlist.Add(item.EventType);
seriesValue.LegendLabel = "Event Type -" + item.EventType.ToString();
EventBarChart.DefaultView.ChartArea.DataSeries.Add(seriesValue);
}
its working properly but , i need to show the bar and legend labels ,
here with i have attached my chart, and another one is how i need the chart legend label.
Regards
M. Asiq Raja