User1310055179 posted
Hi,
I would like to know how to rotate a bit the labels in axis X in line chart or bar chart control?
This is my code:
<ajaxToolkit:LineChart ID="LineChart1" ChartHeight="300" ChartWidth = "450" runat="server" BaseLineColor="#A156AB" Visible="false"></ajaxToolkit:LineChart>
string[] x = new string[graphDataSet.Tables[0].Rows.Count];
decimal[] y = new decimal[graphDataSet.Tables[0].Rows.Count];
for (int i = 0; i < graphDataSet.Tables[0].Rows.Count; i++)
{
x[i] = graphDataSet.Tables[0].Rows[i][0].ToString();
y[i] = Convert.ToInt32(graphDataSet.Tables[0].Rows[i][1]);
}
LineChart1.Series.Add(new AjaxControlToolkit.LineChartSeries { Data = y });
LineChart1.CategoriesAxis = string.Join(",", x);
if (x.Length > 3)
{
LineChart1.ChartWidth = (x.Length * 75).ToString();
}
LineChart1.Visible = true;