Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Formatting dates on x-axis
posted

I'm having an issue with getting text formatted on the x-axis of my composite chart.

Here's the snippet in question:

            AxisItem axisX = new AxisItem();
            axisX.DataType = AxisDataType.String;
            axisX.OrientationType = AxisNumber.X_Axis;
            axisX.SetLabelAxisType = SetLabelAxisType.ContinuousData;
           

            axisX.Labels.Orientation = TextOrientation.Custom;
            axisX.Labels.OrientationAngle = 45;

            axisX.Labels.HorizontalAlign = System.Drawing.StringAlignment.Far;
           
            axisX.Labels.ItemFormat = AxisItemLabelFormat.Custom;
            axisX.Labels.ItemFormatString = "<ITEM_LABEL:MM/dd hh:mm>";

My axis orientationangle works fine, but the itemformat and itemformatstring have no affect on what's displayed on the chart at runtime.

First:

How do I get the text displayed on the x-axis to be in the MM/dd hh:mm format?

Second:

How do I get the dates to not bunch up together so closely? The linechart handles this part nicely, the composite chart doesn't. I have to use the composite chart because I need separate y-axis that share the same x.

 

Parents Reply Children