55
Ultra Chart FillSceneGraph not painting all Primitives
posted

I'm trying to divide a bubble chart into 9 different quadrants drawing lines and labels on the chart using Scene Graph. This requires me to add 10 primitives to scene graph object. After I add the 6th primitive, the chart no longer draws the last 4 objects. I've changed the order of adding the primitives and only the first 6 get drawn, so I know the issue is not with the primitive objects.

I'm using Infragastics Win Forms 16.2. Below is the code in the scene graph

Private Sub UltraChart1_FillSceneGraph(ByVal sender As System.Object, _

ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles UltraBubbleChart.FillSceneGraph

Try

Dim xAxis As IAdvanceAxis = CType(e.Grid("X"), IAdvanceAxis)

Dim yAxis As IAdvanceAxis = CType(e.Grid("Y"), IAdvanceAxis)

If xAxis Is Nothing Or yAxis Is Nothing Then

Return

End If

Dim gridLine As Line = New Line(New Point(xAxis.Map(0.34), yAxis.Map(0)), New Point(xAxis.Map(0.34), yAxis.Map(1)))

gridLine.PE.Stroke = Color.Black

gridLine.PE.StrokeWidth = 5

e.SceneGraph.Add(gridLine)

gridLine = New Line(New Point(xAxis.Map(0.67), yAxis.Map(0)), New Point(xAxis.Map(0.67), yAxis.Map(1)))

gridLine.PE.Stroke = Color.Black

gridLine.PE.StrokeWidth = 5

e.SceneGraph.Add(gridLine)

gridLine = New Line(New Point(xAxis.Map(0), yAxis.Map(0.34)), New Point(xAxis.Map(1), yAxis.Map(0.34)))

gridLine.PE.Stroke = Color.Black

gridLine.PE.StrokeWidth = 5

e.SceneGraph.Add(gridLine)

gridLine = New Line(New Point(xAxis.Map(0), yAxis.Map(0.67)), New Point(xAxis.Map(1), yAxis.Map(0.67)))

gridLine.PE.Stroke = Color.Black

gridLine.PE.StrokeWidth = 5

e.SceneGraph.Add(gridLine)

Dim labelText As New Text()

labelText.PE.Fill = Color.Black

labelText.labelStyle.Font = New Font("Arial", 20.0, FontStyle.Bold)

labelText.bounds = New Rectangle(CInt(xAxis.Map(0.15)), CInt(yAxis.Map(-0.05)), 100, 25)

labelText.SetTextString("Value")

e.SceneGraph.Add(labelText)

labelText = New Text()

labelText.PE.Fill = Color.Black

labelText.labelStyle.Font = New Font("Arial", 20.0, FontStyle.Bold)

labelText.bounds = New Rectangle(CInt(xAxis.Map(0.45)), CInt(yAxis.Map(-0.05)), 100, 25)

labelText.SetTextString("Neutral")

e.SceneGraph.Add(labelText)

labelText = New Text()

labelText.PE.Fill = Color.Black

labelText.labelStyle.Font = New Font("Arial", 20.0, FontStyle.Bold)

labelText.bounds = New Rectangle(CInt(xAxis.Map(0.75)), CInt(yAxis.Map(-0.05)), 50, 25)

labelText.SetTextString("Growth")

e.SceneGraph.Add(labelText)

labelText.PE.Fill = Color.Black

labelText.labelStyle.Font = New Font("Arial", 20.0, FontStyle.Bold)

labelText.bounds = New Rectangle(CInt(xAxis.Map(-0.2)), CInt(yAxis.Map(0.15)), 100, 25)

labelText.SetTextString("Small")

labelText.labelStyle.Orientation = TextOrientation.VerticalLeftFacing

e.SceneGraph.Add(labelText)

labelText = New Text()

labelText.PE.Fill = Color.Black

labelText.labelStyle.Font = New Font("Arial", 20.0, FontStyle.Bold)

labelText.bounds = New Rectangle(CInt(xAxis.Map(-0.2)), CInt(yAxis.Map(0.45)), 100, 25)

labelText.labelStyle.Orientation = TextOrientation.VerticalLeftFacing

labelText.SetTextString("Mid")

e.SceneGraph.Add(labelText)

labelText = New Text()

labelText.PE.Fill = Color.Black

labelText.labelStyle.Font = New Font("Arial", 20.0, FontStyle.Bold)

labelText.bounds = New Rectangle(CInt(xAxis.Map(-0.2)), CInt(yAxis.Map(-0.45)), 100, 25)

labelText.labelStyle.Orientation = TextOrientation.VerticalLeftFacing

labelText.SetTextString("Large")

e.SceneGraph.Add(labelText)

Catch ex As Exception

End Try

End Sub

Below is how I set the data source

With Me.UltraBubbleChart

.DataSource = graphSource

.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart

.Axis.X.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.Custom

.Axis.X.Labels.ItemFormatString = "<DATA_VALUE: ##.####>"

.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto

 .Axis.Y.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart

.Axis.Y.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.Custom

.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:##.####>"

 .DataBind()

 

End With

Parents Reply Children
No Data