This project is read-only.

Multiple Stacked bars workaround help

Topics: General
Jan 3, 2011 at 5:22 PM

I am trying to recreate the "Multiple Stacked Bars" look from the chartssample_multistack.scx demo.  But I am having trouble understanding how to get the second bar, which is the solid-colored "totals" bar, to show up next to each stacked bar.  I am using ChartType=9 (Stacked Bars) just like the sample.  But I would like to know what workaround (as suggested in the demo's caption) was used to create the sample.  My data is setup much in the same way as the sample with individual amounts in the stacked bar.  However, I am unsure of what property(etc..?) I should set my totals data to so it will be in a second bar of its own.

 Any help/suggestions are appreciated...  Thanks!

Using FoxCharts v_1.20 and have VFP9 SP2.

Jan 3, 2011 at 5:41 PM
Edited Jan 3, 2011 at 5:41 PM

Hi

I am not sure I do understand your problem, but when you will look at the chartssample_multistack.scx and you select  Modify you can study the method  Form1.Foxcharts1.Init here you will see how the cursor is build and populate to produce the effect.

Please report back if this does not solve your problem.

Regards,

 

Koen

Jan 17, 2011 at 2:03 AM

Hi Jsupraterj

Sorry for the late answer.

In that sample, all the trick is in the data generation.

The 2nd "Totals" and unique bar is created having all the other bars with value of Zero (or NULL).

With that sample data it's easier to explain:

INSERT INTO sales VALUES ( 130, 100,    80,  55,  NULL)
INSERT INTO sales VALUES (NULL, NULL, NULL, NULL,  400)
INSERT INTO sales VALUES (NULL, NULL, NULL, NULL, NULL)
 



Notice in the 1st sequence, responsible for the left bar, I left the last value with NULL. That needs to be always NULL, because I dint want to show that data in the left bar.

In the 2nd sequence, I put a NULL value to all values, except the last, because I wanted to hide all the stacked bars, and show only the last one having the big value, and unique bar

The 3rd sequence, all with NULLS, is to make FoxCharts not draw any bars, to make a kind of separator, between the next bars to come.

Hope that helps !

Cesar