Print Page | Close Window

Chart Pro connect line points with values only

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=21680
Printed Date: 25 April 2024 at 6:36pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Chart Pro connect line points with values only
Posted By: mfstuart
Subject: Chart Pro connect line points with values only
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net