I have a problem with a LineChart. Ich have a datatable with a datetime on the y-axis and decimals on the x-axis. If all my decimal values are 0 the chart throws a OverflowException beacuse it tries to paint a line from x1 = -2147483555 y1 = 100 to x2 = -2147483555 y2 = 41.
I have no idea why it does not simply paint a line along the x-axis. I am using Version v3.00.20033.
I'm having trouble reproducing this issue. Our line chart doesn't allow numeric values on the x axis, nor does it allow date time values on the y axis. Can you post a sample or a code snippet?
Hi!
First of all im sorry i flipped the axis. i have my dates on the x and the decimals on the y axis.
But now i will explain the problem further. I have a datatable with two columns. The first one is a datetime and the second one a decimal. If i have values in the decimal column all works perfect. But sometimes it can happen that all values in the second column are "0". If that's the case i get the OverflowException.
Here the Stacktrace:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at System.Drawing.Graphics.DrawLine(Pen pen, Point pt1, Point pt2) at Infragistics.UltraChart.Render.IFGGraphics2D.Draw(Line l) at Infragistics.UltraChart.Render.ChartRender.PaintPrimitive(Primitive p) at Infragistics.UltraChart.Render.ChartRender.RenderSceneGraph(SceneGraph scene, Graphics g) at Infragistics.UltraChart.Render.ChartRender.RenderChart(SceneGraph scene, Int32 sceneWidth, Int32 sceneHeight) at Infragistics.Win.UltraWinChart.UltraChart.UltraWinChart_Paint(Object sender, PaintEventArgs e)
It's a strange error. Maybe you can help.
I was still unable to reproduce the problem. This actually might be something that was fixed in the past, so try the following code snippet and if it breaks, try downloading and installing the latest service release for your version of NetAdvantage.
DataTable dt = new DataTable();dt.Columns.Add("col1", typeof(DateTime));dt.Columns.Add("col2", typeof(decimal));dt.Rows.Add(new object[] { DateTime.Parse("1/1/2010"), 0 });dt.Rows.Add(new object[] { DateTime.Parse("2/1/2010"), 0 });dt.Rows.Add(new object[] { DateTime.Parse("3/1/2010"), 0 });dt.Rows.Add(new object[] { DateTime.Parse("4/1/2010"), 0 });dt.Rows.Add(new object[] { DateTime.Parse("5/1/2010"), 0 });
ultraChart1.ChartType = ChartType.LineChart;
ultraChart1.LineChart.TreatDateTimeAsString = false;ultraChart1.Data.SwapRowsAndColumns = true;ultraChart1.DataSource = dt;
Thank you for this answer!
It works perfectly for me.
Again, thank you very much!
In a case where you have all 0s, you can try setting a manual range on your Y axis. Something like this:if (all zeroes) chart.Axis.Y.RangeMin = -1 chart.Axis.Y.RangeMax = 1 chart.Axis.Y.RangeType = AxisRangeType.Custom
Hi,
You can test this code with the trial version 10.3 of Infragistics components which you can download from our website at Infragistics.com.
Let me know if the issue is still present with it.
Regards,
Stefaniya
Thanks for your help, but I am getting the error again. But thats not such a tragedy because we will switch to a hight version i a few months.
But if someone might have an answer it would be great. We use Infragistics 2003 (V3) at the moment.
Again thankt for your help.