Page 1 of 1

while converting series to area chart control is crashed.

Posted: Tue Mar 15, 2016 11:31 am
by 16071129
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));

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

Posted: Tue Mar 15, 2016 11:56 am
by Christopher
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 2317 times
Which version of TeeChart.dll are you using?

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

Posted: Tue Mar 29, 2016 11:33 am
by 16071129
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)

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

Posted: Tue Mar 29, 2016 12:31 pm
by 16071129
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;