Jump to content
Software FX Community

X Axis Date Format issue


FSzymanski

Recommended Posts

 Hello,

I'm trying to build a chart using data from my database with dates on the x axis.  This data may not match up to the current date, so I was attempting to change the format of the x axis labels from the month with an indication of a change in month (e.g. "January `11") to have the format MM-yyyy.  Below is a snippet of setup code that I used:

  chart1.AxisX.LabelsFormat.Format = AxisFormat.LongDate;   chart1.AxisX.LabelsFormat.CustomFormat = "MM-yyyy";   chart1.AxisX.DataFormat.Format = AxisFormat.LongDate;   chart1.AxisX.DataFormat.CustomFormat = "MM-dd-yyyy";   chart1.DataSource = ds.Tables[0];   chart1.AxisX.AutoScale = false;   chart1.View3D.Enabled = true;   chart1.View3D.Cluster = true;   chart1.AllSeries.Border.BetweenSegments = true;   chart1.AllSeries.Border.Width = 3;

When I run the simple app with these settings, I first get a chart that has labels for every other month with the correct format.  As I increase the size of the chart, there comes a point where the label switch to the default long date text containing just the month name.  If I continue to increase the size of the display, I reach another point where I have multiple labels for the same month.

If I add a line setting the X Axis step to 30, then the formatting that I setup is ignored completely and the LongDate formatting is always used.

Any help in resolving this would be appreciated.

 ~Frank

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.

Guest
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...