I want to get the maximum size of the label on any AxisItem of a composite chart.
Any idea how I can get this maximumsize occupied as a size object?
Also please throw some light on how the AxisLabelInfoCollection is being used
internally.
Kumar_Nagaraju said: I want to get the maximum size of the label on any AxisItem of a composite chart. Any idea how I can get this maximumsize occupied as a size object?
i think this code will help:
private void ultraChart1_FillSceneGraph(object sender, FillSceneGraphEventArgs e) { Axis layerXAxis = this.ultraChart1.CompositeChart.ChartLayers[0].ChartLayer.Grid["X"] as Axis; float maxLabelWidth = float.MinValue; float maxLabelHeight = float.MinValue; foreach (Primitive p in e.SceneGraph) { Text t = p as Text; if (t != null && t.bounds.Top > layerXAxis.startPoint.Y) { // assume this is an x-axis label since it's below the x axis SizeF labelSize = Platform.GetLabelSizePixels(t.GetTextString(), t.labelStyle); maxLabelWidth = Math.Max(maxLabelWidth, labelSize.Width); maxLabelHeight = Math.Max(maxLabelHeight, labelSize.Height); } } }
Kumar_Nagaraju said: Also please throw some light on how the AxisLabelInfoCollection is being used internally.
it's used for processing the labels through anti-collision algorithms when Axis.N.Labels.Layout.Behavior is set to Auto or UseCollection. i don't there is any use for this class in an application.