I have a line chart that if there is only 1 value, it is plotting an extra data point at the end. I've set the stroke width of my color model to zero so the line doesn't get displayed. How do i get rid of these extra data points? Why do they even show up? (Click the picture to see entire chart)
The circles you are seeing are line's start and end anchors. Try setting EndStyle to NoAnchor for the line chart appearance. When you only have one data point, the chart will draw a straight line through that point. Visually it will look like you have 2 identical points, but that's only because we need 2 points to draw a line.
I set the linechargt endstyle = to No Anchor, but that didn't seem to work. Here is the LineChart Element i'm using. Is there anything i'm missing? Any other ways to remove that second data point.
<
="DontPlot">
>
="1">
="Small">
/>
Having an IconAppearance forces an icon to be visible on all data points. That is a shape, separate from an actual line anchor, but the anchor won't appear without a line, so my previous suggestion won't be of much use to you. Displaying a single point using a line chart is a pretty special case and there's no "good" way of doing it, but if it muste be done, you can use FillSceneGraph event to hide one of the icons. Here's how you can do it:
//a set of icons for each line is represented by a PointSet, where each icon is a point in the points collection. //this code will work for a line chart that has a line with 2 points and icon appearance enabled.private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e){ foreach (Primitive p in e.SceneGraph) { PointSet set = p as PointSet; if (set != null && set.points.Length == 2) { //make sure the point is not visible and doesn't get mouse events set.points[1].Caps = PCaps.None; set.points[1].Visible = false; } }}
Thanks Max, that is exactly what i was looking for.