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.
Hello,
You should use “<DATA_VALUE:MM/dd hh:mm>” for the ItemFormatString of axisX, instead of "<ITEM_LABEL:MM/dd hh:mm>". On the following link you could find information about label formatting:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Chart_Label_Formatting.html
if you want to make the space ,between the label of the axisX, bigger you could setting:
axisX.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Percentage;
axisX.TickmarkPercentage = 20;
more information about those properties you could find at:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinChart.v11.1~Infragistics.UltraChart.Resources.Appearance.AxisAppearance~TickmarkPercentage.html
Please let me know if you have any further questions
Using: “<DATA_VALUE:MM/dd hh:mm>” just returns the string MM/dd hh:mm on screen. Also changing the following properities caused the axis x labels to overlap.
axisX.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Percentage;axisX.TickmarkPercentage = 20;