Jump to content
Software FX Community

X-Axis labelling with datetime


Recommended Posts


I have Datetime values on the X-Axis and not all labels are displayed (see file attached).

My code:



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;



Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...