User (Legacy) Posted February 11, 2007 Report Share Posted February 11, 2007 Hi, I need your help please. I´m using the commercial ChartFX_7.0.2330 to create a real time chart. I use this function to reset my chart: private void ClearHpsChart() { chartHPS.Data.Clear(); chartHPS.RandomData.Points = 1; chartHPS.RandomData.Series = 2; HpsSeriesAttributes = new ChartFX.WinForms.SeriesAttributes(); AvgHpsSeriesAttributes = new ChartFX.WinForms.SeriesAttributes(); HpsSeriesAttributes.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); HpsSeriesAttributes.Line.Width = ((short)(1)); HpsSeriesAttributes.Text = "Hits per Second"; AvgHpsSeriesAttributes.Color = System.Drawing.Color.DarkCyan; AvgHpsSeriesAttributes.Gallery = ChartFX.WinForms.Gallery.Curve; AvgHpsSeriesAttributes.Line.Width = ((short)(1)); AvgHpsSeriesAttributes.Text = "Average (5 mins)"; chartHPS.Series.AddRange(new ChartFX.WinForms.SeriesAttributes[] { HpsSeriesAttributes, AvgHpsSeriesAttributes }); // <-- Here i get the System.ArithmeticException InitializeHpsChart(); } Now, this works great until i use some saveFileDialog in my application. If i´m saving some file using this dialog the next time the funtion is executed i´m gettings System.ArithmeticException (in the line "chartHPS.Series.AddRange") ! I know this is strange since the dialog got nothing to do with the chart code but maybe the dialog changes some environment variable that causes the library to throw an exception. Please help me, thanks Full stack trace: System.ArithmeticException occurred Message="Overflow or underflow in the arithmetic operation." Source="mscorlib" StackTrace: at System.Double.IsNaN(Double d) at ChartFX.WinForms.DataProviders.f.a.a(Random A_0, Double A_1, Boolean A_2, Boolean A_3) at ChartFX.WinForms.DataProviders.f.a.a(Random A_0, Double A_1, Int32 A_2, Boolean A_3, Boolean A_4) at ChartFX.WinForms.DataProviders.f.a(Int32 A_0, Double A_1, Random A_2) at ChartFX.WinForms.DataProviders.f.b.a(Object A_0) at ChartFX.WinForms.DataSourceSettings.a() at ChartFX.WinForms.DataSourceSettings.e() at ChartFX.WinForms.DataSourceSettings.set_DataSource(Object value) at ChartFX.WinForms.Chart.set_DataSource(Object value) at ChartFX.WinForms.Chart.a(IDataProvider A_0) at ChartFX.WinForms.DataValues.b(Int32 A_0, Int32 A_1) at ChartFX.WinForms.DataValues.a(RandomFlags A_0) at ChartFX.WinForms.Chart.ax() at ChartFX.WinForms.Chart.get_Series() at Dynamite.ChartsPanelUC.ClearHpsChart() in C:\Documents and Settings\kharel\My Documents\Visual Studio 2005\Projects\DynamiteV7\Dynamite\ChartsPanelUC.cs:line 53 Link to comment Share on other sites More sharing options...
Software FX Posted February 11, 2007 Report Share Posted February 11, 2007 This is very strange, I cannot imagine what relationship the File Dialog may have with this code. I was unable to reproduce this problem on my side. Please post a sample program that reproduces the problem. -- Francisco Padron www.chartfx.com "Kfir Harel" <kharel@finjan.com> wrote in message news:AtHFNUfTHHA.3900@webserver3.softwarefx.com... > Hi, > > I need your help please. > I´m using the commercial ChartFX_7.0.2330 to create a real time chart. I > use this function to reset my chart: > > private void ClearHpsChart() > { > chartHPS.Data.Clear(); > chartHPS.RandomData.Points = 1; > chartHPS.RandomData.Series = 2; > HpsSeriesAttributes = new ChartFX.WinForms.SeriesAttributes(); > AvgHpsSeriesAttributes = new > ChartFX.WinForms.SeriesAttributes(); > HpsSeriesAttributes.Color = > System.Drawing.Color.FromArgb(((int)(((byte)(192)))), > ((int)(((byte)(0)))), ((int)(((byte)(192))))); > HpsSeriesAttributes.Line.Width = ((short)(1)); > HpsSeriesAttributes.Text = "Hits per Second"; > AvgHpsSeriesAttributes.Color = System.Drawing.Color.DarkCyan; > AvgHpsSeriesAttributes.Gallery = > ChartFX.WinForms.Gallery.Curve; > AvgHpsSeriesAttributes.Line.Width = ((short)(1)); > AvgHpsSeriesAttributes.Text = "Average (5 mins)"; > chartHPS.Series.AddRange(new > ChartFX.WinForms.SeriesAttributes[] { HpsSeriesAttributes, > AvgHpsSeriesAttributes }); // <-- Here i get the > System.ArithmeticException > InitializeHpsChart(); > } > > Now, this works great until i use some saveFileDialog in my application. > If i´m saving some file using this dialog the next time the funtion is > executed i´m gettings System.ArithmeticException (in the line > "chartHPS.Series.AddRange") ! I know this is strange since the dialog got > nothing to do with the chart code but maybe the dialog changes some > environment variable that causes the library to throw an exception. > > Please help me, > thanks > > > Full stack trace: > > System.ArithmeticException occurred > Message="Overflow or underflow in the arithmetic operation." > Source="mscorlib" > StackTrace: > at System.Double.IsNaN(Double d) > at ChartFX.WinForms.DataProviders.f.a.a(Random A_0, Double A_1, > Boolean A_2, Boolean A_3) > at ChartFX.WinForms.DataProviders.f.a.a(Random A_0, Double A_1, > Int32 A_2, Boolean A_3, Boolean A_4) > at ChartFX.WinForms.DataProviders.f.a(Int32 A_0, Double A_1, Random > A_2) > at ChartFX.WinForms.DataProviders.f.b.a(Object A_0) > at ChartFX.WinForms.DataSourceSettings.a() > at ChartFX.WinForms.DataSourceSettings.e() > at ChartFX.WinForms.DataSourceSettings.set_DataSource(Object value) > at ChartFX.WinForms.Chart.set_DataSource(Object value) > at ChartFX.WinForms.Chart.a(IDataProvider A_0) > at ChartFX.WinForms.DataValues.b(Int32 A_0, Int32 A_1) > at ChartFX.WinForms.DataValues.a(RandomFlags A_0) > at ChartFX.WinForms.Chart.ax() > at ChartFX.WinForms.Chart.get_Series() > at Dynamite.ChartsPanelUC.ClearHpsChart() in C:\Documents and > Settings\kharel\My Documents\Visual Studio > 2005\Projects\DynamiteV7\Dynamite\ChartsPanelUC.cs:line 53 > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.