From: SourceForge.net <no...@so...> - 2009-03-25 01:33:14
|
Bugs item #1688713, was opened at 2007-03-26 16:19 Message generated for change (Settings changed) made by jamcquay You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=821568&aid=1688713&group_id=161868 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: randalx (randalx) >Assigned to: Nobody/Anonymous (nobody) Summary: Problems ploting single point Initial Comment: Hi, My program plots various LinePlots and PointPlots using the AbscissaData and OrdinateData. The data can change based on user interaction. A bug occurs when the data is for only one point. First there is an exception in DateTimeAxis.cs void DrawTicks(...) { ... PointF lastPos = WorldToPhysical((double)largeTicks[0], physicalMin, physicalMax, true);//ed The exception is due to accessing largeTicks[0]. The previous call to WorldTickPositions() fails to add any data to the largeTicks array. A quick fix was to add the following code: if (largeTicks.Count <= 0) { return; } But the result is not very satisfactory as I'd still like to see the point plotted. My temporary hack was to adjust the XAxis1.WorldMax and XAxis1.WorldMin by 100 so as to show a centered point but this is far from ideal. Thanks, Randal ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-03-03 15:39 Message: Logged In: NO Hi guys ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-05-11 04:43 Message: Logged In: NO I have rather similar problem with 5 point at LabelAxis.cs This is Stack Trace of 0.9.9.2 but it happen in 0.9.10.0 as well. System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at NPlot.LabelAxis.DrawTicks(Graphics g, Point physicalMin, Point physicalMax, Object& labelOffset, Object& boundingBox) in LabelAxis.cs:line 209 at NPlot.Axis.Draw(Graphics g, Point physicalMin, Point physicalMax, Rectangle& boundingBox) in Axis.cs:line 1280 at NPlot.PhysicalAxis.Draw(Graphics g, Rectangle& boundingBox) in PhysicalAxis.cs:line 125 at NPlot.PhysicalAxis.GetBoundingBox() in PhysicalAxis.cs:line 112 at NPlot.PlotSurface2D.DeterminePhysicalAxesToDraw(Rectangle bounds, Axis xAxis1, Axis xAxis2, Axis yAxis1, Axis yAxis2, PhysicalAxis& pXAxis1, PhysicalAxis& pXAxis2, PhysicalAxis& pYAxis1, PhysicalAxis& pYAxis2) in PlotSurface2D.cs:line 831 at NPlot.PlotSurface2D.Draw(Graphics g, Rectangle bounds) in PlotSurface2D.cs:line 972 at NPlot.Bitmap.PlotSurface2D.Refresh() in Bitmap.PlotSurface2D.cs:line 433 ---------------------------------------------------------------------- Comment By: Jamie McQuay (jamcquay) Date: 2007-03-29 12:26 Message: Logged In: YES user_id=613279 Originator: NO Code snippet: plotSurface.Clear(); DateTime[] xs = { new DateTime(2002, 9, 1)}; float[] ys = { 4.7f }; Marker m = new Marker(Marker.MarkerType.Diamond, 6, Color.DarkGreen); PointPlot pp = new PointPlot(); pp.AbscissaData = xs; pp.OrdinateData = ys; pp.Marker = m; plotSurface.Add(pp); LabelAxis lay = new LabelAxis(plotSurface.YAxis1); lay.AddLabel("P3", 3); lay.AddLabel("P4", 4); lay.AddLabel("P5", 5); plotSurface.YAxis1 = lay; plotSurface.Refresh(); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=821568&aid=1688713&group_id=161868 |