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);
Looking at the ScatterLayer source when a point is encountered as null and NullHandling is set to DontPlot the point is removed entirely from the plotted points. With ConnectLines set to true, line segments are then drawn between all the points that exist. So as it stands now there would be no gap where the null was encountered. Please bear with me as I'm looking into what we can do to remedy this or provide you with some sort of workaround.
nHi,
When using NullHandling.DontPlot the point is removed from the PointSet and a PolyLine is created to draw a line to each point in the PointSet. There will not be a gap when a null is encountered. Instead you can set ConectWithLines to false and draw the polyline yourself. An easy way to get a PointSet for each non-null segment is to set the NullHandling to Zero and as a result a PointSet will be created for each segment. Then you can add a PolyLine for each PointSet (segment). I attached an example chart that does this based upon the code you previously posted using a CompositeChart with a ScatterChart layer added.