Jump to content
Software FX Community

Stacked Bar Confusion


User (Legacy)

Recommended Posts

I'm having some simple trouble getting a stacked bar graph to look the way I

need it to and I've attached a sample of the image I'm getting.

What I'm looking for is to have BLUE between -1 and -.2

Then RED betwen -.2 through the zero line and up to .7

Then Green to the top.

Thanks!

.Gallery = SoftwareFX.ChartFX.Gallery.Bar

.Stacked = SoftwareFX.ChartFX.Stacked.Normal

.AxisY.ForceZero = False

.OpenData(Cfx.COD.Values, 4, 1)

.Value(0, 0) = -1

.Value(1, 0) = -0.2

.Value(2, 0) = 0.7

.Value(3, 0) = 2.3

.Point(0, 0).Color = Color.Blue

.Point(1, 0).Color = Color.Red

.Point(2, 0).Color = Color.Red

.Point(3, 0).Color = Color.Green

.AxisX.Label(0) = "Ranges"

.AxisY.Grid.Width = 0.5

.CloseData(Cfx.COD.Values)

.AxisY.Max = 2.3

.AxisY.Min = -1

Link to comment
Share on other sites

Stacked charts are used to ACCUMULATE the values, you don't pass the value 

where you want the bar to end, instead you pass the difference with respect

to the previous bar.

I think what you want is NOT a stacked chart but a bar chart where you can

control where each bar starts and ends, you can achieve this with the

following code:

.Gallery = SoftwareFX.ChartFX.Gallery.Bar

.Cluster = True

.OpenData(COD.Values, 3, 1)

.OpenData(COD.IniValues, 3, 1)

.IniValue(0, 0) = -1

.IniValue(1, 0) = -0.2

.IniValue(2, 0) = 0.7

.Value(0, 0) = -0.2

.Value(1, 0) = 0.7

.Value(2, 0) = 2.3

.Point(0, 0).Color = Color.Blue

.Point(1, 0).Color = Color.Red

.Point(2, 0).Color = Color.Green

.AxisX.Label(0) = "Ranges"

.AxisY.Grid.Width = 0.5

.CloseData(COD.Values)

.CloseData(COD.IniValues)

.AxisY.Max = 2.3

.AxisY.Min = -1

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

That was it exactly!

Thanks

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:k$Ab3mwVFHA.2236@webserver3.softwarefx.com...

> Stacked charts are used to ACCUMULATE the values, you don't pass the value

> where you want the bar to end, instead you pass the difference with

respect

> to the previous bar.

>

> I think what you want is NOT a stacked chart but a bar chart where you can

> control where each bar starts and ends, you can achieve this with the

> following code:

>

> .Gallery = SoftwareFX.ChartFX.Gallery.Bar

>

> .Cluster = True

>

> .OpenData(COD.Values, 3, 1)

>

> .OpenData(COD.IniValues, 3, 1)

>

> .IniValue(0, 0) = -1

>

> .IniValue(1, 0) = -0.2

>

> .IniValue(2, 0) = 0.7

>

> .Value(0, 0) = -0.2

>

> .Value(1, 0) = 0.7

>

> .Value(2, 0) = 2.3

>

> .Point(0, 0).Color = Color.Blue

>

> .Point(1, 0).Color = Color.Red

>

> .Point(2, 0).Color = Color.Green

>

> .AxisX.Label(0) = "Ranges"

>

> .AxisY.Grid.Width = 0.5

>

> .CloseData(COD.Values)

>

> .CloseData(COD.IniValues)

>

> .AxisY.Max = 2.3

>

> .AxisY.Min = -1

>

>

> --

> Francisco Padron

> www.chartfx.com

>

>

Link to comment
Share on other sites

  • 4 months later...

For this you will have to stay with Stacked with all the implications of it 

(all the problems Italo was having).

In the new version (7) we have added a way to make the bars Side-By-Side or

Cluster independent of the "3D Cluster" setting, this allows you to have

"non side-by-side bars) in a non-3D- cluster chart. which is what you need.

There is only one problem though, since the bars are in the same Z, they

need to be in the right order otherwise the projection of one will draw on

top of the other, once you chose an order, you will be limited to a range of

rotation angles (X-Axis) that will work. For example if you lay out the bars

so that the first series is the one on top, you can not look at this chart

from underneath, if you do it will look all wrong.

--

Francisco Padron

www.chartfx.com

"Chris Muno" <tofumuno@hotmail.com> wrote in message

news:jbb7KL8tFHA.2656@webserver3.softwarefx.com...

> The code listed works for 2D but in 3D the individual bars that make up

> the "stacked" bar don't line up in the z-axis. Is there anyway to make

> them line up? The volume property of the series seems to be the only way

> to control this but that can only make them touch not overlap and stack

> up. Thanks.

>

>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...