while converting series to area chart control is crashed.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

while converting series to area chart control is crashed.

Post by Quant » Tue Mar 15, 2016 11:31 am

while converting series to area chart control is crashed.
I am using following code.

Code: Select all

            Candle newSeries = new Candle();
            tChart1.Series.Add(newSeries);
            newSeries.FillSampleValues(100);
            Series axy =  tChart1.Series[0];
            Series.ChangeType(ref axy, typeof(Steema.TeeChart.Styles.Area));

Christopher
Guru
Posts: 1229
Joined: Fri Nov 15, 2002 12:00 am

Re: while converting series to area chart control is crashed.

Post by Christopher » Tue Mar 15, 2016 11:56 am

Quant wrote:while converting series to area chart control is crashed.
I am using following code.
Using that code I cannot reproduce the problem here, and the result I obtain is the following:
Chart635936433698944843.png
Chart635936433698944843.png (31.84 KiB) Viewed 2318 times
Which version of TeeChart.dll are you using?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: while converting series to area chart control is crashed.

Post by Quant » Tue Mar 29, 2016 11:33 am

I am getting following error

Unhandled Exception:

Object reference not set to an instance of an object.

System.NullReferenceException

Stack Trace:
at Steema.TeeChart.Styles.Custom.DrawPoint(Boolean drawOldPointer, Int32 valueIndex, Int32 x, Int32 y)
at Steema.TeeChart.Styles.Custom.DrawValue(Int32 valueIndex)
at Steema.TeeChart.Styles.Custom.DoDrawIndex(Int32 Index, Boolean CanID)
at Steema.TeeChart.Styles.Series.Draw()
at Steema.TeeChart.Styles.Custom.Draw()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: while converting series to area chart control is crashed.

Post by Quant » Tue Mar 29, 2016 12:31 pm

error resolved by assigning color to arealines.

Code: Select all

 Series.ChangeType(ref candleseries, typeof(Steema.TeeChart.Styles.Area));
 Area eqArea = (Area) candleseries;
 eqArea.AreaLines.Color = Color.Red;

Post Reply