I am trying to display daily production data on a line chart in pounds of product produced per hour. We have 2 departments that appear on this chart however, some days 1 of the 2 departments may not be scheduled for production. On these days in my chart, I don't want to show a zero value for pounds per hour because it shows as a sharp dip in productivity. I need the line chart to skip that day for the zero value.Can anyone shed some light on how I can accomplish this?My datasource is a datatable with decimal values for the points on the line.Thanks in advance for your help,Trevor BraunThe Stirling Creamery Ltd.
Hello Tevor,
The line series has an UnknownValuePlotting enum you can set to Don'tPlot.
Thanks David. I finally got to attempt this yesterday. I'm new to C# and not very good at it. I ended up creating a few more arraylists to capture the row and column and data values for passing to the getFillColor method and it did work. Maybe I'll figure out how to use a jagged array to make it more efficient. Will post some code later. Wanted to thank you and say that it worked. Thanks again!
Allen
allenovereem said:Now if I could just synch the color of the ellipse with the color that is going to be displayed for that point in the legend...any ideas?
The legend icons should also be in your SceneGraph, and their Path properties should all include the string "Legend." they will also have their Row and Column properties set... so you should be able to change the color of the legend items as needed.
or, you could try finding the correct color for your ellipse using this.ChartColorModel.getFillColor(...).
I modified slightly for my implementation and this works great.
Now if I could just synch the color of the ellipse with the color that is going to be displayed for that point in the legend...any ideas?
Your idea for posting code appears to work well too. Here I'm using Firefox and I've copied the code from VS2003 into WordPad and then copied that to here. At least at this point the formatting appears intact!
Thanks!
added to the end of FillSceneGraph...
IAdvanceAxis xAxis = this.Grid["X"] as IAdvanceAxis; IAdvanceAxis yAxis = this.Grid["Y"] as IAdvanceAxis; int rowCount = this.ChartData.GetRowCount(); int colCount = this.ChartData.GetColumnCount(); ArrayList iPointsOut = new ArrayList(); for (int r = 0; r < rowCount; r++) { int indexOfNonNullPoint = -1; bool isolated = true; for (int c = 0; c < colCount; c++) { object objectValue = this.ChartData.GetObjectValue(r, c); if (objectValue != null && !(objectValue is System.DBNull)) { if (indexOfNonNullPoint != -1) { isolated = false; break; } indexOfNonNullPoint = c; } } if (isolated) { object objectValue = this.ChartData.GetObjectValue(r, indexOfNonNullPoint); double dataValue = System.Convert.ToDouble(objectValue); int xPosition = System.Convert.ToInt32(xAxis.Map(indexOfNonNullPoint)); int yPosition = System.Convert.ToInt32(yAxis.Map(dataValue)); iPointsOut.Add(new Point(xPosition, yPosition)); } } //Point[] isolatedPoints = this.GetIsolatedPoints(); foreach (Point isolatedPoint in iPointsOut) { // draw an ellipse Ellipse plotPoint = new Ellipse(isolatedPoint, 4); plotPoint.PE.Fill = Color.Black; plotPoint.Layer = this; // add the ellipse to the scene. scene.Add(plotPoint); }
Thanks. This looks like it has the potential to do it. Unfortunately I'm using VS2003 (writing to SCM4.5) so I'll have to figure out how to implement it differently than you have here before I bless it. Again thanks and I'll be back.