Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 StackedBarPlot example
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rixmith

33 Posts

Posted - 04 Jun 2015 :  18:41:07  Show Profile  Reply with Quote
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

quinncurtis

1558 Posts

Posted - 05 Jun 2015 :  16:24:55  Show Profile  Reply with Quote
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.
Go to Top of Page

rixmith

33 Posts

Posted - 07 Jun 2015 :  09:25:14  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07