![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | Arrow and Historgram charts throw error on zooming | ||
|---|---|---|---|
| Product: | .NET TeeChart | Reporter: | Sunil Ramesh <sunil.ramesh> |
| Component: | Chart | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | chris |
| Priority: | Highest | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
| Attachments: |
Sample application to simulate
Sample application to simulate Workaround I have attached a screen video |
||
The version I am using is TeeChartNET2018_4.1.2018.05040 I'm afraid I can't reproduce this issue here - I made a screenvideo of my attempt you can see here: http://www.teechart.net/files/public/support/2018-08-28_16-43-06.gif (the zoom rectangle issue is an artifact of the video-making process) I have attached a sample to simulate and a screenshot Created attachment 849 [details]
Sample application to simulate
Run the application and keep on zooming in where you have too many points
Created attachment 850 [details]
Sample application to simulate
here is a onedrive link to the video https://1drv.ms/u/s!Atm48KvNL-Bl6TzBSw105x0SJxbZ Created attachment 851 [details]
Workaround
We have been able to reproduce this issue here. Attached is a Form1.cs in which a workaround to this issue can be found. The fix has already been added to the source code.
Same happens with Historgram as well. Is this also fixed? I can't reprodue this issue in the Histogram series - in fact a fix to it was made at the end of 2015: http://bugs.teechart.net/show_bug.cgi?id=1372 I am able to same code, just change the type to Histogram and you will get the below exception System.OverflowException: Negating the minimum value of a twos complement number is invalid. at System.Math.AbsHelper(Int32 value) at Steema.TeeChart.Styles.Histogram.CalcRectangle(Int32 valueIndex) at Steema.TeeChart.Styles.Histogram.DrawValue(Int32 valueIndex) at Steema.TeeChart.Styles.Series.DoDrawIndex(Int32 Index, Boolean CanID) at Steema.TeeChart.Styles.Series.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) 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) Zoom at the peaks and then continue zooming in Zoom in at the peaks of the histogram and continue even if no points are visible. I'm using this code:
private void InitializeChart()
{
tChart1.Header.Text = Utils.Version;
Histogram ax = new Histogram();
ax.FillSampleValues(5000);
tChart1.Series.Add(ax);
}
and here I zoom in 20 times without being able to reproduce your issue:
http://www.teechart.net/files/public/support/2018-08-30_11-16-36.gif
Created attachment 852 [details]
I have attached a screen video
I am using the code below. Replace the below in Arrow sample attached before (WindowsFormsApp1.zip Form1_Load)
Histogram ax = new Histogram();
ax.FillSampleValues(5000);
tChart1.Series.Add(ax);
Okay. I'm afraid I still haven't been able to reproduce this here, but I think I understand what might be happening. The stack trace mentions Math.Abs(), and this method is only called three times in the Histogram class's code. I have made a small adjustment based on the information here: https://stackoverflow.com/questions/16131544/cant-get-value-for-math-abs-2147483648 Unfortunately there's no workaround I can offer you, because the method involved is marked as internal, but I can offer you a TeeChart.dll you might like to try to see if the issue has been fixed: http://www.teechart.net/files/public/support/TeeChart_4.2018.8.30.zip I have tested your updated dll and it works ok now, so the issue is fixed I guess. When will you be releasing the update? Okay, that's great. I think the next release will be due out at the end of this third quarter or the beginning of the fourth. |
Add Arrow or Histogram with sample values (FillSampleValues) and then keep on zooming in, you get overflow expectation. Arrow ax = new Arrow(); ax.FillSampleValues(); tChart1.Series.Add(ax); System.OverflowException: Overflow error. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at Steema.TeeChart.Drawing.Graphics3DGdiPlus.LineTo(Int32 x, Int32 y) at Steema.TeeChart.Drawing.Graphics3D.Arrow(Boolean Filled, Point FromPoint, Point ToPoint, Int32 ArrowWidth, Int32 ArrowHeight, Int32 Z, Double ArrowPercent) at Steema.TeeChart.Drawing.Graphics3D.Arrow(Boolean Filled, Point FromPoint, Point ToPoint, Int32 ArrowWidth, Int32 ArrowHeight, Int32 Z) at Steema.TeeChart.Styles.Arrow.DrawValue(Int32 valueIndex) at Steema.TeeChart.Styles.Series.DoDrawIndex(Int32 Index, Boolean CanID) at Steema.TeeChart.Styles.Series.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.TChart.Draw(Graphics g) at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)