Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 StackedBarPlot example

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

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.

Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07