Hi,
I have data that I need to present in a linechart. Some values are actual, and some are estimated. I have a DataSource column in my table that is set to 'A' for actual or 'E' for estumated.
I would like to use different shapes for data points on my chart depending on the value of DataSource. Could you please explain how to do this.
Thanks,
Helen.
The only way to do this is to handle FillSceneGraph event and overlay symbol icons on top of existing line points.
Private Sub UltraChart1_FillSceneGraph(ByVal sender As System.Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles UltraChart1.FillSceneGraph Dim shapeArray As New ArrayList Dim line As Polyline
shapeArray.Add("A") shapeArray.Add("E") shapeArray.Add("E") shapeArray.Add("A") shapeArray.Add("E")
For Each p As Primitive In e.SceneGraph If TypeOf p Is Polyline Then line = CType(p, Polyline) Next
If line Is Nothing Then Exit Sub
For i As Integer = 0 To line.points.Length - 1 Dim s As New Symbol If shapeArray(i) = "A" Then s.icon = SymbolIcon.Circle Else s.icon = SymbolIcon.Square End If
s.iconSize = SymbolIconSize.Large s.point = line.points(i).point e.SceneGraph.Add(s) Next End Sub
Hi Mike,
I was unable to resolve this.
I am trying to create a linechart, and assign different shapes to different datapoints depending on a value of a status column.
I attached my chart where I drew some circles and squares around different data points to illustrate what I am trying to do.
Here is the code
ucChart.Data.DataSource = dt
ucChart.Data.SwapRowsAndColumns = True
ucChart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.LineChart
ucChart.LineChart.TreatDateTimeAsString = False
ucChart.LineChart.NullHandling = Infragistics.UltraChart.Shared.Styles.NullHandling.DontPlot
'set wording on the chart
ucChart.Axis.X.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal
ucChart.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:MM/dd/yyyy>"
ucChart.Axis.Y.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal
ucChart.TitleTop.Text = "Inventory History For " & dt.Rows(0).Item("productDesc")
ucChart.TitleTop.Font = New System.Drawing.Font("Ariel", 14.0F, FontStyle.Bold)
ucChart.TitleTop.Visible = True
ucChart.TitleBottom.Text = "Inventory Date"
ucChart.TitleBottom.Font = New System.Drawing.Font("Ariel", 8.5F, FontStyle.Regular) '
ucChart.TitleBottom.Visible = True
ucChart.Data.DataBind()
Helen,
Have you been able to resolve this issue? If you still require assistance please refer to my previouls reply asking for more details which would help me investigate this issue further.
Michael S.
Are you using a ScatterChart with ConnectWithLines set to "true"? Or are you actually using a LineChart?
Would it be possible for you to attach a screen shot of a chart with sample data in it showing exactly what you want to do?