jusim Posted November 24, 2009 Report Share Posted November 24, 2009 Hi, I have Datetime values on the X-Axis and not all labels are displayed (see file attached). My code: chart.Data.Clear(); chart.DataSourceSettings.Fields.Clear(); Type type = points.Columns[0].DataType; if (type == typeof(decimal) || type.IsPrimitive || type == typeof(DateTime)) // type = Datetimechart.DataSourceSettings.Fields.Add(new FieldMap(points.Columns[0].Caption, FieldUsage.XValue)); elsechart.DataSourceSettings.Fields.Add(new FieldMap(points.Columns[0].Caption, FieldUsage.Label)); for (int i = 1; i < points.Columns.Count; ++i)chart.DataSourceSettings.Fields.Add(new FieldMap(points.Columns.Caption, ChartFX.WinForms.FieldUsage.Value)); chart.AxisX.LabelsFormat.Format = AxisFormat.Date; chart.DataSource = points; Sincerely Quote Link to comment Share on other sites More sharing options...
CarlosAC Posted November 24, 2009 Report Share Posted November 24, 2009 Hi jusim You can check the 3 properties on XAxis labels: step, angle, and staggered. Please try following code: chart1.AxisX.Step = 1;chart1.AxisX.LabelAngle = 45; also chart1.AxisX.Step = 1;chart1.AxisX.Staggered = true; -- Pipon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.