Jump to content
Software FX Community

Changing display format on X-Axis

User (Legacy)

Recommended Posts


In my chart, I am insterested in changing the display format of time on

x-axis to hh am/pm

I am using the code written below, but it always makes it hh a0/p0 or

a1/p1...and so on.

I also tried hh AM/PM and other ways but it just does not work.

Can anyone help?

chartStandardDay.AxisX.LabelsFormat.CustomFormat = "hh:mm a.m./p.m."


Link to comment
Share on other sites

To format time and date values we use standard .NET formatting routines.

Please check .NET documentation on "Custom DateTime Format Strings ".

You will see that the character designated for A.M./P.M. is 't'.

For example:

chart1.AxisX.LabelsFormat.CustomFormat = "hh:mm tt";

Will display:

12:00 PM

10:00 AM



Software FX

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...