Information is Wealth...

legend top of ASP.net chart control

legend top of ASP.net chart control, To place the legend on top of ASP.net chart control

 /*Add the following Code in the Code Behind

   Chart.Legends[0].Docking = Docking.Top;

   Chart.Legends[0].BackColor = Color.White;


ASP.net chart control stacked bar column chart

ASP.net chart control stacked bar column chart

To  make ASP.net chart control look like a stacked bar column chart

Add the Following in Code behind:

// Code to make the chart look like stacked
 Chart2.Series[0].ChartType = SeriesChartType.StackedColumn;

 Chart2.Series[1].ChartType = SeriesChartType.StackedColumn;

 Chart2.Series[2].ChartType = SeriesChartType.StackedColumn;

 Chart2.Series[3].ChartType = SeriesChartType.StackedColumn;

x axis labels stacked bar ASP.Net chart controls


x axis labels stacked bar ASP.Net chart controls


If the X-axis doesn't show all labels for the stacked bar chart control

 

We need to add this in codebehind :

 

Chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;

 

In .aspx :

 

AxisX  IsLabelAutoFit="true"

LabelStyle Angle="-90" Interval="1" 

MajorTickMark Enabled ="false"