user4jas Posted June 22, 2010 Share Posted June 22, 2010 1. Hello All - With 3 columns "At time" ,"customers out of power","customers restored of power" ,I have 2 bar charts in a multi axis chart (placed in the summary band). Details of chart are:Chart 1. Chart data -series expression (Static value)"customers restored ", (Bar color green) category expn : column "At Time" , value expn : column : "customers restored of power"Chart 2 . Chart data -series expression (Static value)"customers out ", (Bar color Red) category expn : column :"At Time" , value expn : Column : "customers out of power "Isuues : since they have the same Category Expression .The Bar overlaps one another for the same time block and it seems like the parent chart takes precedence .At a given time:i.e 1. if cust restored bar green bar value > cust out bar (red) bar value ,it hides the red bar 2. If cust restored bar(green)value< cust out ,it shows the lesser green projection on the bigger red bar .So here i would want to know if . 1.There is a way to offset any one bar to display the two bars side by side to each other. If there is .Please let me know the code. Thank you Link to comment Share on other sites More sharing options...
mpetek Posted July 1, 2010 Share Posted July 1, 2010 Why are you not using two category series in a single bar chart instead of the multi-axis chart?Am I missing something? Link to comment Share on other sites More sharing options...
drizzt21 Posted August 26, 2011 Share Posted August 26, 2011 Hi,I'm currently facing the same problem. The difference is, that my two bar charts have different value types. Chart 1. Chart data -series expression "Number of clicks"category expn : column "Week of Year"value expn : column : "Clicks" <= quantity e.g. 200 Chart 2 . Chart data -series expression "Costs"category expn : column :"Week of Year"value expn : Column : "Costs" <= currency e.g. "1.123,00 €" Therefore I do need two different value axis. The two bars should be placed next to each other (with a small spacing) and should not overlap. Any suggestions?Post Edited by drizzt21 at 08/26/2011 11:55 Link to comment Share on other sites More sharing options...
clshafer Posted November 11, 2012 Share Posted November 11, 2012 Did you every find an answer to this question? I am having the same problem and don't see any answers that adress this. Link to comment Share on other sites More sharing options...
niyu.cuatro Posted March 30, 2016 Share Posted March 30, 2016 It's a bit late but maybe this helps someone in the future.I managed to solve this exact same problem by adding empty series and using a chart customizer.My category series look like this: <categorySeries> <seriesExpression><![CDATA["sales"]]></seriesExpression> <categoryExpression><![CDATA[$F{REGION}]]></categoryExpression> <valueExpression><![CDATA[$F{RES}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[""]]></seriesExpression> <categoryExpression><![CDATA[$F{REGION}]]></categoryExpression> <valueExpression><![CDATA[0]]></valueExpression> </categorySeries>[/code] <categorySeries> <seriesExpression><![CDATA[""]]></seriesExpression> <categoryExpression><![CDATA[$F{REGION}]]></categoryExpression> <valueExpression><![CDATA[0]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA["orders"]]></seriesExpression> <categoryExpression><![CDATA[$F{REGION}]]></categoryExpression> <valueExpression><![CDATA[$F{SUMA}]]></valueExpression> </categorySeries>[/code]In each one of the multiaxis' axis.Then with a Chart customizer setted on the multiaxis:public class BarChartSeparator implements JRChartCustomizer { @Override public void customize(JFreeChart chart, JRChart jasperChart) { // TODO Auto-generated method stub chart.getCategoryPlot().getRenderer(0).setSeriesVisibleInLegend(1, false); chart.getCategoryPlot().getRenderer(1).setSeriesVisibleInLegend(0, false); }}[/code]It may not be the most elegant solution posible, but it does the job. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now