Print Page | Close Window

How to use SetDashArray in ChartLineStyle

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=19539
Printed Date: 22 November 2024 at 10:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use SetDashArray in ChartLineStyle
Posted By: SimasJ
Subject: How to use SetDashArray in ChartLineStyle
Date Posted: 01 March 2012 at 12:25pm
Hi,

I am sorry but I mistakenly posted this question in a different group. Here is the question:

I would like to create a series using a Dash style wider than the standard ones. I found the method SetDashArray in the ChartLineStyle object which appears to be what I need but I cannot find any documentation about it. Would you please provide an example of its usage?

Best Regards,
Jose Simas



Replies:
Posted By: SuperMario
Date Posted: 06 March 2012 at 1:19pm
DashArray you pass in an array with the pattern to follow.  It can be as short or long as you like.  It will follow the pattern you specify, if you specify 3 segments, then it will repeat those 3 segments.  If you specify 1 segment, it will repeat this 1 segment.  You must specify BOTH segment length and gap length or else you will get only a solid line.

For example, this is a little bigger than the standard dash:

xLineStyle.LineStyle.SetDashArray (Array(5, 2))

this is the pattern:

SetDashArray (Array(Segment1 width, first gap width, Segment2 width, second gap width, etc, etc))

These are also valid:

xLineStyle.LineStyle.SetDashArray (Array(2, 1, 5, 2))
xLineStyle.LineStyle.SetDashArray (Array(2, 1, 5, 2, 8, 3))

Here is code:

    Dim xLineStyle As ChartLineSeriesStyle
    Dim nThickness As Integer
    
    nThickness = 5
    
    Set xLineStyle = New ChartLineSeriesStyle
    xLineStyle.LineStyle.DashStyle = xtpChartDashStyleCustom
    xLineStyle.LineStyle.Thickness = nThickness
    xLineStyle.LineStyle.SetDashArray (Array(5, 2))
    Set ChartControl.Content.Series(0).Style = xLineStyle

Hope this helps


Posted By: SimasJ
Date Posted: 12 March 2012 at 3:52pm
Hi,

Thanks for the very clear explanation. Solved my problem completely.

Cheers,
Jose



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