Exception while drawing Custom Axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Avijit
Newbie
Newbie
Posts: 72
Joined: Tue Sep 15, 2009 12:00 am

Exception while drawing Custom Axis

Post by Avijit » 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 -

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exception while drawing Custom Axis

Post by Sandra » Wed Jul 28, 2010 9:14 am

Hello Avijit,

I couldn't reproduce your problem here.Could you please send us a simple example because we can reproduce your problem here?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply