I have a column chart that I need to display data points on. I'm not sure if this is the correct terminology so I'm including the chart I have in Excel. I need to be able to place the little triangles on the columns to represent an event that happened in that month. Make sense.
Hello Bill,
I am following up to see were you able to use the suggestion Max has provided using stored procedure.
Thanks,
Bhadresh
I'm still a little unclear how to get my stored procedure fed datasource to the FillSceneGraph sub and how to loop through the chart but I will give it my best shot. Thanks Max.
Something like this: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load UltraChart1.Data.DataSource = New Integer(,) {{1, 1}, {2, 2}, {3, 3}, {4, 4}} End Sub
Private Sub UltraChart1_FillSceneGraph(ByVal sender As System.Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles UltraChart1.FillSceneGraph If e.Grid.Count = 0 Then Return End If
Dim itemsPerGroup = 2 Dim position = 2
Dim xAxis As IAdvanceAxis = e.Grid("X") Dim yAxis As IAdvanceAxis = e.Grid("Y")
Dim s As Symbol = New Symbol(SymbolIcon.Triangle, SymbolIconSize.Large) Dim pos = 1 + position * (itemsPerGroup + UltraChart1.ColumnChart.SeriesSpacing) Dim value As Double = 2.5 s.point = New Point(xAxis.Map(pos), yAxis.Map(value)) s.PE.Fill = Color.Blue e.SceneGraph.Add(s)
position = 3 value = 3.2 pos = 1 + position * (itemsPerGroup + UltraChart1.ColumnChart.SeriesSpacing) s = New Symbol(SymbolIcon.Triangle, SymbolIconSize.Large) s.point = New Point(xAxis.Map(pos), yAxis.Map(value)) s.PE.Fill = Color.Blue e.SceneGraph.Add(s) End Sub
Do you have a VB.NET code example of how I could loop through the SceneGraph to accomplish this?
That would be much harder to do, because additional columns introduce additional space that needs to be allocated to specific groups of columns. When the column's value is 0, the chart will display a column with 0 height, but the width of the column still has to be accounted for. As a result, you will have a gap where column's value is a zero. Personally, I think adding triangle symbols is much easier.