T O P I C R E V I E W |
rixmith |
Posted - 04 Jun 2015 : 18:41:07 In the GroupBarChart class of the example code, you provide an example of a StackedBarPlot. What must be changed in the example to get the stacked bars to be drawn horizontally (the x and y axis are inverted)?
I tried adding 1 line to the example code:
thePlot2.setBarOrient(HORIZ_DIR); (see code below)
but that (alone) breaks the example.
StackedBarPlot thePlot2 = new StackedBarPlot(pTransform2, Dataset1, ChartCalendar.getCalendarWidthValue(Calendar.YEAR,0.75), 0.0, attribArray, ChartConstants.JUSTIFY_CENTER); NumericLabel bardatavalue = thePlot2.getPlotLabelTemplate(); bardatavalue.setTextFont(theFont); bardatavalue.setNumericFormat(ChartConstants.CURRENCYFORMAT); bardatavalue.setDecimalPos(1); bardatavalue.setColor(Color.black); thePlot2.setPlotLabelTemplate(bardatavalue); thePlot2.setBarDatapointLabelPosition(ChartConstants.CENTERED_BAR); thePlot2.setShowDatapointValue(true); thePlot2.setBarOrient(HORIZ_DIR); //this line breaks example gWG.addChartObject(thePlot2);
I'm not sure what else must be changed,
Rick |
2 L A T E S T R E P L I E S (Newest First) |
rixmith |
Posted - 07 Jun 2015 : 09:25:14 Thank you for directing me to the bargraphs.LandOfTheFry example : I will find my answer there.
The code in my original post is from the bargraphs.GroupBarChart example, which does indeed use TimeCoordinates for the StackedBarPlot.
Rick |
quinncurtis |
Posted - 05 Jun 2015 : 16:24:55 There is a horizontal stacked bar example: bargraphs.LandOfTheFry. It uses a CartesianCoordinates coordinate system (numeric scale for x and y).
You seem to be using a time coordinate system. Is that the case? Do you want a time-based x-axis or y-axis? What exactly does your data look like? Do you have time-based x-values in your TimeGroupDataset and numeric values as the y-group values. |
|
|