Jump to content
Software FX Community

Floating Stacked Charts Problem


User (Legacy)
 Share

Recommended Posts

Hi

Using your excellent previous suggestions I create floating stacked charts,

using YFrom and Yvalue. The problem is if the stacked values start below

zero.

See the code below. It produces the attached chart. (The data is just

duplicated). The problem is the second series values seems to get assigned

again to the third series, producing an error on the high side. The third

series should end at -900, below the y axis.

Any clues to what I'm doing wrong or is it a bug?

Many thanks

Paul

---------------------------------------------------------

Option Explicit

Private Sub Form_Load()

Dim dblSeries1Cum As Double

Dim dblSeries2Cum As Double

dblSeries1Cum = 0

dblSeries2Cum = 0

With ChartFX1

.Chart3D = False

.ClearData CD_DATA

'.Cluster = True

With .Axis(AXIS_Y)

.ResetScale

.ForceZero = False

End With

.OpenDataEx COD_VALUES, 6, 1

.OpenDataEx COD_INIVALUES, 6, 1

.Series(0).YFrom(0) = -3000

.Series(0).Yvalue(0) = -2600

.Series(1).YFrom(0) = -2600

.Series(1).Yvalue(0) = 1600

.Series(2).YFrom(0) = -1000

.Series(2).Yvalue(0) = 100

' .Series(0).YFrom(0) = -3000

' .Series(0).Yvalue(0) = -2600

' dblSeries1Cum = .Series(0).Yvalue(0)

' .Series(1).YFrom(0) = dblSeries1Cum

' .Series(1).Yvalue(0) = 1600

' dblSeries1Cum = dblSeries1Cum + .Series(1).Yvalue(0)

' .Series(2).YFrom(0) = dblSeries1Cum

' .Series(2).Yvalue(0) = 0 '-300 ' -2191 - (-2609)

.Series(3).YFrom(0) = -3000

.Series(3).Yvalue(0) = -2600

.Series(4).YFrom(0) = -2600

.Series(4).Yvalue(0) = 1600

.Series(5).YFrom(0) = -1000

.Series(5).Yvalue(0) = 100

.CloseData COD_INIVALUES

.CloseData COD_VALUES

.Series(0).Gallery = BAR

.Series(1).Gallery = BAR

.Series(1).Stacked = True

.Series(2).Gallery = BAR

.Series(2).Stacked = True

.Series(3).Gallery = BAR

.Series(3).Stacked = False

.Series(4).Gallery = BAR

.Series(4).Stacked = True

.Series(5).Gallery = BAR

.Series(5).Stacked = True

.RecalcScale

With .Axis(AXIS_Y)

.Min = -4000

.Max = 2000

End With

End With

End Sub

--

____________________________________

Paul Nailand

Visual Risk Pty Ltd

u: www.visualrisk.com

t: +61 (2) 9262 6969

m:+61 (0) 413 002 802

e: paul@visualrisk.com

Need Help with Hedging? - Think Visual Risk

Software and Consulting Services for Financial Risk Management

This email and any attachments is intended only for the person to whom

it is addressed. It may contain confidential information. If you receive

this document in error, please immediately delete it from your system

and notify the sender. You must not disclose, copy, use or rely on any

part of this document if you are not the intended recipient.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...