Please help. How do I create a chart that has only x axis plots along the bottom that has labels that are string values not numeric?
so the plots should be:
O O O---------------------------------------------------------------------------PPW Reponsible Person OIM PTW Admin Inactivate
with no line. the circles represent if a form has been approved and by which role.
Please advise how to create this ultrachart.
Also I need a right margin so the chart isn't cut off.
UltraChart1.Axis.X.TickmarkStyle = AxisTickStyle.DataIntervalUltraChart1.ScatterChart.IconSize = SymbolIconSize.LargeUltraChart1.ScatterChart.Icon = SymbolIcon.CircleUltraChart1.ChartType = ChartType.ScatterChartUltraChart1.ScatterChart.ConnectWithLines = False
Here's a pic of the final chart.
I tried adding the points as vbnull and also Nothing, and then added the "DontPlot":
UltraChart1.LineChart.NullHandling = Infragistics.UltraChart.Shared.Styles.NullHandling.DontPlot
but when I did that, nothing at all was plotted on the chart.
I solved this issue by taking the point on the map where the 0 value would be plotted, (In my case it is 54. It depends on, of course, the size of the chart), and adding a condition that prevents plots if the Y axis value equals the point where 0 would be plotted.
Looks perfect now. I'm sure there's a better way but this works for now. I'll eventually collect the plot values from a stored procedure. Here's the final solution..
Public Sub LoadChart() Dim dt As New DataTable Dim tnull As Int32 = Nothing
dt.Columns.Add("Series Labels", GetType(String))
dt.Columns.Add("PPW Submitted", GetType(Integer)) dt.Columns.Add("Responsible Person Approved", GetType(Integer)) dt.Columns.Add("OIM Approved", GetType(Integer)) dt.Columns.Add("PTW Admin Activated", GetType(Integer)) dt.Columns.Add("De-Activated (Responsible Person)", GetType(Integer)) dt.Columns.Add("Closed (OIM)", GetType(Integer))
'Add the rows of data dt.Rows.Add(New [Object]() {"Workflow", 10, 10, 10, 0, 0, 0})
UltraChart1.ChartType = ChartType.LineChart UltraChart1.Axis.X.Labels.Orientation = TextOrientation.Horizontal UltraChart1.Axis.X.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.ItemLabel UltraChart1.Axis.Y.Labels.Visible = False
Me.UltraChart1.DataSource = dt Me.UltraChart1.DataBind() End Sub
Private Sub Chart_FillSceneGraph(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) _ Handles UltraChart1.FillSceneGraph
Dim i As Int32 = 0 Dim dataPointColour As System.Drawing.Color Dim symbol As Infragistics.UltraChart.Core.Primitives.Symbol Dim symbols As New Infragistics.UltraChart.Core.Primitives.PrimitiveCollection
For Each p As Infragistics.UltraChart.Core.Primitives.Primitive In e.SceneGraph Dim polyline As Infragistics.UltraChart.Core.Primitives.Polyline
If (TypeOf p Is Infragistics.UltraChart.Core.Primitives.Polyline) Then polyline = CType(p, Infragistics.UltraChart.Core.Primitives.Polyline) Else polyline = Nothing End If
If polyline IsNot Nothing Then dataPointColour = polyline.PE.Fill polyline.PE.Fill = Color.Transparent
For Each dataPoint As Infragistics.UltraChart.Core.Primitives.DataPoint In polyline.points symbol = New Infragistics.UltraChart.Core.Primitives.Symbol() If Convert.ToInt32(polyline.points(i).point.Y) <> 54 Then symbol.icon = Infragistics.UltraChart.Shared.Styles.SymbolIcon.Circle symbol.iconSize = Infragistics.UltraChart.Shared.Styles.SymbolIconSize.Large symbol.PE.Fill = dataPointColour symbol.point = dataPoint.point symbols.Add(symbol) End If
i += 1 Next End If Next
e.SceneGraph.AddRange(symbols.ToArray()) End Sub
Hello,
Instead to add points with value 0, add it as Noting and set LineChart.NullHnadaling to DontPlot:
UltraChart2.LineChart.NullHandling = NullHandling.DontPlot
http://help.infragistics.com/Help/NetAdvantage/WinForms/2013.1/CLR4.0/html/Infragistics4.Win.UltraWinChart.v13.1~Infragistics.UltraChart.Resources.Appearance.LineChartAppearance~NullHandling.html
Also I think that maybe you could consider to use UltraGrid, instead of chart, so the intervals will become ultraGridColumns and you could have checkbox in order to indicate the role for that form.
Please let me know if you have any further questions.
I'm partly there. But the plots that have a 0 value shouldn't be plotted but they are. How do I check that if the bounds are "00", color the plot Transparent?
Private Sub Chart_FillSceneGraph(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) _ Handles UltraChart2.FillSceneGraph
Dim dataPointColour As System.Drawing.Color Dim symbol As Infragistics.UltraChart.Core.Primitives.Symbol Dim symbols As New Infragistics.UltraChart.Core.Primitives.PrimitiveCollection
If Not polyline Is Nothing Then dataPointColour = polyline.PE.Fill polyline.PE.Fill = Color.Transparent
For Each dataPoint As Infragistics.UltraChart.Core.Primitives.DataPoint In polyline.points symbol = New Infragistics.UltraChart.Core.Primitives.Symbol() symbol.icon = Infragistics.UltraChart.Shared.Styles.SymbolIcon.Circle symbol.iconSize = Infragistics.UltraChart.Shared.Styles.SymbolIconSize.Large symbol.PE.Fill = dataPointColour symbol.point = dataPoint.point symbols.Add(symbol) Next
End If
Next
Public Sub LoadChart() Dim dt As New DataTable
dt.Columns.Add("PPW", GetType(Integer)) dt.Columns.Add("Responsible Person", GetType(Integer)) dt.Columns.Add("OIM", GetType(Integer)) dt.Columns.Add("PTW Admin", GetType(Integer)) dt.Columns.Add("De-Activate", GetType(Integer)) dt.Columns.Add("Close", GetType(Integer))
' Add the rows of data dt.Rows.Add(New [Object]() {"Workflow", 5, 5, 0, 0, 0, 0})
UltraChart2.ChartType = ChartType.LineChart UltraChart2.Axis.X.Labels.Orientation = TextOrientation.Horizontal UltraChart2.Axis.X.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.ItemLabel
Me.UltraChart2.DataSource = dt Me.UltraChart2.DataBind() End Sub