Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Chart Control
  New Posts New Posts RSS Feed - How to use SetDashArray in ChartLineStyle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to use SetDashArray in ChartLineStyle

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


Joined: 22 February 2006
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote SimasJ Quote  Post ReplyReply Direct Link To This Post Topic: How to use SetDashArray in ChartLineStyle
    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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
SimasJ View Drop Down
Newbie
Newbie


Joined: 22 February 2006
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote SimasJ Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2012 at 3:52pm
Hi,

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

Cheers,
Jose
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.