I'm brand new to the Chart Pro ActiveX.
I've created a Chart Pro v15.3.1 Dashed Line chart with 7 X axis points. 3 of the points have values greater than zero and the other 4 equal zero.
I want a line to the 3 points with values greater than zero only, not have the chart draw the line to all the points.
'=====
Option Explicit
Private Sub Form_Load()
AddTitle "Height-To-Age", myChart
AddHeightSeries
AddHeightAxis
End Sub
Private Sub AddTitle(ByVal Title As String, ByRef oChart As ChartControl)
Dim oContent As ChartContent
Dim oTitle As ChartTitle
Set oContent = oChart.Content
Set oTitle = oContent.Titles.Add("<TextBlock FontSize='14px' Foreground='Blue'>" & Title & "</TextBlock>")
oContent.EnableMarkup = True
oContent.Legend.Visible = False
End Sub
Private Sub AddHeightSeries()
Dim Series As ChartSeries
Set Series = myChart.Content.Series.Add("Height")
With Series
.Name = "Height"
.Points.Add 24, 0
.Points.Add 60, 34
.Points.Add 96, 0
.Points.Add 132, 51
.Points.Add 168, 67
.Points.Add 204, 0
.Points.Add 240, 0
End With
Dim oStyle As ChartSplineSeriesStyle
Set oStyle = New ChartSplineSeriesStyle
oStyle.LineStyle.DashStyle = xtpChartDashStyleDash
Set myChart.Content.Series(0).Style = oStyle
End Sub
Private Sub AddHeightAxis()
Dim Diagram As ChartDiagram2D
Set Diagram = myChart.Content.Series(0).Diagram
If Not (Diagram Is Nothing) Then
With Diagram
.AxisX.Title.Text = "Age Months"
.AxisX.Title.Visible = True
.AxisY.Title.Text = "Height Inches"
.AxisY.Title.Visible = True
End With
End If
End Sub