Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Chart Control
  New Posts New Posts RSS Feed - Chart Pro connect line points with values only
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Chart Pro connect line points with values only

 Post Reply Post Reply
Author
Message
mfstuart View Drop Down
Newbie
Newbie


Joined: 28 May 2013
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mfstuart Quote  Post ReplyReply Direct Link To This Post Topic: Chart Pro connect line points with values only
    Posted: 28 May 2013 at 6:39pm
Hi all,
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.
How do I do that? Are there properties to set that?

Here's my VB6 code:
'=====
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
'=====
Thanx,
Mark Stuart
VB6
Magic eDeveloper v9
uniPaaS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.