Hi,
I have a problem to use a compositechart with several scatterchart. I want that scatterchart does not display a line between the points is null.I put NullHandling.DontPlot to NullHandling Option but that does not seem to function.
Can you help me.
Thanks.
Below part of the code :
lineLayer = new ChartLayerAppearance();
lineSeries = new XYSeries();
lineLayer.AxisX = aAxisX;
lineLayer.AxisY = aAxisY;
lineLayer.AxisX.Labels.ItemFormat = AxisItemLabelFormat.Custom;
lineLayer.AxisX.Labels.ItemFormatString = "<TIMESTAMP> ";
lineLayer.AxisX.DataType = AxisDataType.Numeric;
lineSeries.Data.DataSource = ds.Tables["DATA"];
lineSeries.Data.ValueXColumn ="TimeStamp";
lineSeries.Data.ValueYColumn = nom;
lineSeries.Label = nom +":" + unite;
PaintElement myPaintElement = new PaintElement(couleur);
myPaintElement.Hatch = Infragistics.UltraChart.Shared.Styles.
FillHatchStyle.Horizontal;
myPaintElement.StrokeWidth = epaisseur;
lineSeries.PEs.Add(myPaintElement);
lineLayer.ChartType = ChartType.ScatterChart;
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).ConnectWithLines = true;
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).NullHandling = NullHandling.DontPlot;
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).Icon = (FormPrincipale.myParamLoc.AffichePointCourbe ? SymbolIcon.Circle : SymbolIcon.None);
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).IconSize = SymbolIconSize.Small;
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).LineAppearance.DrawStyle = LineDrawStyle.Solid;
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).LineAppearance.SplineTension = (float)0;
((ScatterChartAppearance)(lineLayer.ChartTypeAppearance)).LineAppearance.Thickness = epaisseur;
lineLayer.Series.Add(lineSeries);
lineLayer.ChartArea = area;
chart.CompositeChart.ChartLayers.Add(lineLayer);
chart.CompositeChart.Series.Add(lineSeries);
Thank you for your answer, it's ok.
Bye
An additional note on that workaround is you would have to set the clip of the appropriate graphics contexts to make sure the points and the grid lines don't go out of the new bounds as well.
Ah you must be using a margin on one of the axis... You will need to workaround that by either not setting the margin on the axis or in FillSceneGraph event handler do this as well as the other stuff we put in there before:
Infragistics.UltraChart.Core.Primitives.GraphicsContext graphicsContext;
for (int i = scene.Count - 1; i > 0; i--) { // find the graphics used for the polyline graphicsContext = scene[i] as Infragistics.UltraChart.Core.Primitives.GraphicsContext; if (graphicsContext != null) { System.Drawing.Rectangle rectangle = graphicsContext.GetClipBounds(); // set the graphics clip bounds to the innerbound of the chart area rectangle = this.ultraChart1.CompositeChart.ChartAreas[0].InnerBounds; double axisMargin = this.axisY.Margin.Far.Value; if (axisMargin != 0.0) { // need to adjust for margins hard-coded for example rectangle.Y = rectangle.Height / 2 + 10; rectangle.Height = rectangle.Height / 2 + 10; } // set the clip graphicsContext.SetClipBounds(rectangle); break; } }
// make sure the chart rerenders its layers now that we've messed with them. this.ultraChart1.InvalidateLayers();
My version of ultraWinChart dll is V12.2, I attache a example of problem.
Thanks
The example didn't attach. I know there were some bugs in the past about the zoom not properly taking line segments out of the rendering but I believe I fixed all those. What version are you using? Can you attach a sample and a screenshot showing what part is rendering incorrectly?