Hello I want to plot the the Year under the X axis of my bar chart, I have the column name under each bar but the year isn't displayed
Here is the code I wrote :
DataTable table = new DataTable(); table .Columns.Add("Year", typeof(String)); table .Columns.Add("Value", typeof(System.Int32)); table .Columns.Add("Esperance", typeof(System.Int32)); table .Rows.Add(new object[ {"2008", 9150000, 11888124}); table .Rows.Add(new object[ {"2009", 9150000, 11792015}); table .Rows.Add(new object[ {"2010", 9150000, 11696682}); table .Rows.Add(new object[ {"2011", 9150000, 11602120}); table .Rows.Add(new object[ {"2012", 9150000, 11508323});
chart.Data.DataSource = table ; chart.Data.DataBind();
Can you tell me wich property allow me to do that
Thanks
When you say under the X axis, I assume you mean column chart. I tested this sample table and it seems to work correctly. The labels under each column are known as item labels and are controlled by chart.Axis.X.Labels.ItemFormat. The labels you are asking about is known as the series labels and are controlled by chart.Axis.X.Labels.SeriesLabels.FormatString. Also, make sure Visible is set to true under chart.Axis.X.Labels.SeriesLabels.
documentation on labels:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Chart_Labels.html
Ok thanks that was it !