Exception in axis.MaxLabelsWidth()
Posted: Fri Aug 11, 2006 5:20 am
Hi,
I am drawing multiple axes on one chart. They are organised horizontally, and the spacing between them I set according to MaxLabelsWidth so I can get the best possible fit.
The problem is It randomly gives me an exception. The exception occurs in System.Drawing.Graphics.MeasureString(...)
Having googled this, it seems to be a common problem and indicates a bug in MeasureString(). Do you have any suggestions to find the width I need for an axis?
The axes are using AutoMatic mode for some and preset for others.
thanks,
System.ArgumentException occurred
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea)
at System.Drawing.Graphics.MeasureString(String text, Font font)
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.MeasureString(ChartFont f, String text)
at Steema.TeeChart.Drawing.Graphics3D.TextWidth(String text)
at Steema.TeeChart.Chart.MultiLineTextWidth(String s, Int32& numLines)
at Steema.TeeChart.AxisLabels.InternalLabelSize(Double value, Boolean isWidth)
at Steema.TeeChart.AxisLabels.LabelHeight(Double value)
at Steema.TeeChart.Axis.get_CalcIncrement()
at Steema.TeeChart.Axis.MaxLabelsValueWidth()
at Steema.TeeChart.Axis.MaxLabelsWidth()
at TE.TI.Trend.UI.TrendControl.SetAxisPlacement(Boolean fUseGraphics) in E:\workspaces\trend\tipsinfoviewer\src\TE.TI.Trend.UI\TrendControl.cs:line 1048
I am drawing multiple axes on one chart. They are organised horizontally, and the spacing between them I set according to MaxLabelsWidth so I can get the best possible fit.
The problem is It randomly gives me an exception. The exception occurs in System.Drawing.Graphics.MeasureString(...)
Having googled this, it seems to be a common problem and indicates a bug in MeasureString(). Do you have any suggestions to find the width I need for an axis?
The axes are using AutoMatic mode for some and preset for others.
thanks,
System.ArgumentException occurred
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea)
at System.Drawing.Graphics.MeasureString(String text, Font font)
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.MeasureString(ChartFont f, String text)
at Steema.TeeChart.Drawing.Graphics3D.TextWidth(String text)
at Steema.TeeChart.Chart.MultiLineTextWidth(String s, Int32& numLines)
at Steema.TeeChart.AxisLabels.InternalLabelSize(Double value, Boolean isWidth)
at Steema.TeeChart.AxisLabels.LabelHeight(Double value)
at Steema.TeeChart.Axis.get_CalcIncrement()
at Steema.TeeChart.Axis.MaxLabelsValueWidth()
at Steema.TeeChart.Axis.MaxLabelsWidth()
at TE.TI.Trend.UI.TrendControl.SetAxisPlacement(Boolean fUseGraphics) in E:\workspaces\trend\tipsinfoviewer\src\TE.TI.Trend.UI\TrendControl.cs:line 1048