RE: STACKED BARS
"Chris McKay" <[email protected]> Fri, 12 Nov 2004 10:28:17 +1300
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[email protected]> |
Yes, this is actually possible in the latest Alpha 1.0 CVS release.
So from the test/StackedBarTestDriver.java code base if we pass the
following data points:
double[][] data = {{-280, 16, -150, 90, 60, 200, 150, 60 },
{80, 216, -10, 30, 15, 90, 150, 87 } };
Paint[] paints = {Color.yellow, Color.blue };
String[] legendLabels = {"Test Legend Label", "second set"};
AxisChartDataSet axisChartDataSet = new AxisChartDataSet(
data, legendLabels, paints, ChartType.BAR_STACKED, stackedBarChartProperties
);
String[] axisLabels = {"1900", "1950", "2000", "2050",
"3000", "3050", "4000", "4050" };
IAxisDataSeries dataSeries = new DataSeries( axisLabels,
"Cookies", "Years", null );
dataSeries.addIAxisPlotDataSet( axisChartDataSet );
ChartProperties chartProperties = new ChartProperties();
AxisProperties axisProperties = new AxisProperties( false );
DataAxisProperties yAxis = (DataAxisProperties)
axisProperties.getYAxisProperties();
yAxis.setShowZeroLine(true);
We get the attached chart:
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf
> Of Thiago Henrique Burgos
> Sent: Thursday, 11 November 2004 1:47 a.m.
> To: [email protected]
> Subject: [jCharts-users] STACKED BARS
>
> is it possible to put negative values on a stacked bar? Ex.:
> I would like to put a positve value for a stack and a
> negative value for the other stack on the same bar.
>
> --
> Thiago Henrique Burgos
> Engenheiro de Configuração
StackedBarChartTest.png
(application/octet-stream, 5.6 KB) - not displayed