I am using AxisTickStyle.Smart for my charts so that the labels for the x axis (in this case Dates) do not bunch up and overlap. This works fine for other charts (stack line charts etc.),but doesn't work for a Stacked Column chart (also the labels will not appear vertically as set using Axis.X.Labels.SeriesLabels.Orientation).
ultraChart.Axis.X.TickmarkStyle = AxisTickStyle.Smart;ultraChart.Axis.Y.TickmarkStyle = AxisTickStyle.Smart;
I'm using NetAdvantage 5.3 for .NET 1.1
Thanks
the Orientation property can get reset at runtime if you change the ChartType property. otherwise, it should work -- but make sure you are setting the SeriesLabels orientation ...
IRenderLabel can't be used to change the text orientation. you can use the ChartDrawItem event to do this, though. just catch it when e.Primitive is Infragistics.UltraChart.Core.Primitives.Text and e.Primitive.Path.IndexOf("Grid.Y") != -1, and change the orientation on the Text primitive there.
NetAdvantage 2006 Vol. 2 added an anti-collision axis labels feature that should prevent this from happening with a simple property setting.
Thanks for your help David.
The orientation property seems to be ignored/reset at runtime unfortunately, but I can change this using an IRenderLabel class.
I was hoping there might be an easier solution than creating my own smart ticks using IRenderLabel for this one graph type, but that will have to do for the moment.
Do you happen to know if this has been fixed in Net Advantage CLR 2.0?
you should be able to change the series labels' orientation without any problem using this code:
this.ultraChart1.Axis.X.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing;
however, the TickmarkStyle does not affect Series labels, so setting that property will be ineffective in this case. if you want to implement an "every nth label" solution, you can do so by implementing IRenderLabel (and returning an empty string for most labels), or through a custom layer (by removing excessive labels from the SceneGraph or setting their text to an empty string.