posted 21 years ago
Hi Ritu,
Not exactly sure what your problem is. But I can try and explain how to get stacked bars.
1. Assume: same number of points in each series
2. Figure out how many pixels we have for the height -> maxPixels
3. For each point:
Add up all series values at that point to get maximum value (100%) -> maxValue[i]
4. For each series at point i:
Number of pixels to draw it will be (maxPixels * seriesValue[i]) / maxValue[i]
5. Start at lowest point and use answer to 4 and keep adding to ylocation until all series have been drawn.
6. Return to 3 and keep going until all series and points are complete.
For horizontal size just figure out how many pixels you are dealing with in the horizontal direction. Divide by the number of points and draw your bars with some small gap between them.
Below is some code that kind-of shows what I mean.
Regards,
Manfred.
[ April 15, 2002: Message edited by: Manfred Leonhardt ]
[ April 15, 2002: Message edited by: Manfred Leonhardt ]