User (Legacy) Posted July 14, 2003 Report Share Posted July 14, 2003 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.