Exception while drawing Custom Axis
Posted: Tue Jul 27, 2010 11:54 am
Hi,
I am getting an unhandles exception while drawing Custom Vertical Axis.
I have created the custom axis and added the start and end position to is.
I have associated a Fast line series to that custom axis too.
Now when i am asking the custom axis to draw it throws an unhandled exception.
What i did is -
i am getting the below axception -
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="TeeChart"
StackTrace:
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.LineTo(Int32 x, Int32 y)
at Steema.TeeChart.Drawing.Graphics3D.LineTo(Int32 x, Int32 y, Int32 z)
at Steema.TeeChart.Drawing.Graphics3D.VerticalLine(Int32 x, Int32 top, Int32 bottom, Int32 z)
at Steema.TeeChart.Axis.DrawLineSegment(Int32 aStart, Int32 aEnd)
at Steema.TeeChart.Axis.AxisDraw.TicksGridDraw.DrawTicksGrid(Int32[]& tempTicks, Int32& tempNumTicks, Double& tempValue)
at Steema.TeeChart.Axis.AxisDraw.Draw(Boolean calcPosAxis)
at Steema.TeeChart.Axis.Draw(Boolean calcPosAxis)
InnerException:
-Avijit
I am getting an unhandles exception while drawing Custom Vertical Axis.
I have created the custom axis and added the start and end position to is.
I have associated a Fast line series to that custom axis too.
Now when i am asking the custom axis to draw it throws an unhandled exception.
What i did is -
Code: Select all
Axis CustomAxis = mcTeeChartEleFactory.GetCustomAxis();
CustomAxis.StartEndPositionUnits = PositionUnits.Percent;
CustomAxis.StartPosition = _StartPos;
CustomAxis.EndPosition = _EndPos;
CustomAxis.Automatic = true;
//Process and get the series of the trends
foreach (ITrend Trend in _Stack.Trends)
{
//Process the trend data and
//get the data in Series format
Series _FastLine = _DP.GetData(Trend);
_FastLine.CustomVertAxis = CustomAxis;
ChartControl.Series.Add(_FastLine);
}
//Setting few axis properties
CustomAxis.MinorGrid.Visible = true;
CustomAxis.MinorTicks.Visible = false;
CustomAxis.Grid.Visible = true;
CustomAxis.Labels.Visible = false;
//Add the new Custom axis to the pool
ChartControl.Axes.Custom.Add(CustomAxis);
CustomAxis.Draw(false);
ColorBand _Band = mcTeeChartEleFactory.GetBandTool();
_Band.Axis = CustomAxis;
_Band.Start = _StartPos;
_Band.End = _EndPos;
//Set the next stack position
_StartPos = _EndPos;
_EndPos += _StackSize;
i am getting the below axception -
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="TeeChart"
StackTrace:
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.LineTo(Int32 x, Int32 y)
at Steema.TeeChart.Drawing.Graphics3D.LineTo(Int32 x, Int32 y, Int32 z)
at Steema.TeeChart.Drawing.Graphics3D.VerticalLine(Int32 x, Int32 top, Int32 bottom, Int32 z)
at Steema.TeeChart.Axis.DrawLineSegment(Int32 aStart, Int32 aEnd)
at Steema.TeeChart.Axis.AxisDraw.TicksGridDraw.DrawTicksGrid(Int32[]& tempTicks, Int32& tempNumTicks, Double& tempValue)
at Steema.TeeChart.Axis.AxisDraw.Draw(Boolean calcPosAxis)
at Steema.TeeChart.Axis.Draw(Boolean calcPosAxis)
InnerException:
-Avijit