Chart label angle
ChartLabelAngle.aspx
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@Import Namespace="System.Web.UI.DataVisualization.Charting" %>
<!DOCTYPE html>
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
Chart1.ChartAreas[0].AxisX.LabelStyle.Angle = 90;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>How to set change Chart label angle programmatically in asp.net</title>
<style type="text/css">
h2
{
color:DarkBlue;
font-style:italic;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>Chart example and tutorial: How to set change<br /> Chart label angle programmatically in asp.net</h2>
<hr width="525" align="left" color="DarkBlue" />
<br />
<asp:Chart
ID="Chart1"
runat="server"
Width="525"
BackColor="Salmon"
BorderlineColor="DarkRed"
BorderlineDashStyle="Dash"
>
<Series>
<asp:Series
Name="AnnualSalary"
YValueType="Int32"
ChartArea="DefaultChartArea"
XValueType="Single"
Color="DarkSalmon"
>
<Points>
<asp:DataPoint AxisLabel="Munni" YValues="37900" />
<asp:DataPoint AxisLabel="Monalisa" YValues="29695" />
<asp:DataPoint AxisLabel="Sabiha" YValues="11250" />
<asp:DataPoint AxisLabel="Soheli" YValues="9850" />
<asp:DataPoint AxisLabel="Mousumi" YValues="16250" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea
Name="DefaultChartArea"
BackColor="WhiteSmoke"
>
<Area3DStyle Enable3D="true" />
<AxisX>
<MajorGrid LineColor="LightSalmon" />
<LabelStyle ForeColor="DarkRed" />
</AxisX>
<AxisY>
<MajorGrid LineColor="LightSalmon" />
<LabelStyle ForeColor="DarkRed" />
</AxisY>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
<br />
<asp:Button
ID="Button1"
runat="server"
Text="Set Chart AxisX Label Angle 90"
Font-Bold="true"
OnClick="Button1_Click"
ForeColor="DarkBlue"
Height="45"
/>
</div>
</form>
</body>
</html>

