android - achartengine two bar graph in one graph -


I have a question that I want to create two graphs in an article. Which means that once the graph starts from 0 and a graph starts at 100. In other words, for example, a graph is 0 ~ 20 and in the same vertical value, 80 ~ 100.

And one more question is now, my Wi-axis variable is not showing up completely, is there any way to fix this? Thank you.

This is my code:

  executed public intent (reference reference) {double] minValues ​​= new double [] {0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0}} Double [] maxValues ​​= new double [] (7, 12, 24, 28, 33, 35, 37, 36, 28, 19, 11, 4}; double [] Minvalulations 2 = new double [] {80 , 70,60,30,20,10,30,40,50,60,80,90}; double [] maxValues2 = new double [] (100, 100, 100, 100, 100, 100, 100, 100, 100,100, 100,100}; XYMultipleSeries dataset dataset = New XYMultipleSeriesDataset (); Category Category Series = New Category Category ("Temperature"); Category Category Series 2 = New Category Category ("Temperature 2"); Int Length = Minvalues For length (int k = 0; k & lt; length; k ++) {series.add (minwalues ​​[k], m (Int k = 0; k & lt; length; k ++) {series2.add (minValues ​​[k], maximum value [k]); dataset.se (series) .toXYSeries ()); dataset.addSeries (series2.toXYSeries ()); Int [] Color = new int [] {Color.CYAN}; XYMultipleSeriesRenderer Renderer = BuildBuilder (Color); renderer.setOrientation (Orientation.VERTICAL); SetChartSettings (Renderer, "Monthly Temperature Range", "", "Percentage", 0.5, 12.5, 0, 100, Color., GRA, Color. LTGRAY); Renderer.setBarSpacing (0.5); Renderer.setXLabels (0); Renderer.setYLabels (10); Renderer.addXTextLabel (0.9, "Var1"); Renderer.addXTextLabel (1.9, "Var2"); Renderer.addXTextLabel (2.9, "Var3"); Renderer.addXTextLabel (3. 9, "Var4"); Renderer.addXTextLabel (4.9, "Var5"); Renderer.addXTextLabel (5.9, "Var6"); Renderer.addXTextLabel (6.9, "to 7"); Render. Adjust Labels (7.9, "VERS8"); Renderer.addXTextLabel (8.9, "Var9"); Render. Adjust Labels (9.9, "to 10"); Renderer.addXTextLabel (10.9, "Var11"); Renderer.addXTextLabel (11.9, "Var12"); Renderer.setYLabelsPadding (30); Renderer.setYLabelsAlign (Align.LEFT); Double xmin = 0; Double xmx = 100; Double Yamin = 0; Double ymax = 100; Double [] border = new double [] {xmin, xmx, yum, wmax}; Renderer.set margin (new int [] (30, 70, 10, 0); renderer.setYLabelsAlign (Align.RIGHT); renderer.setPanLimits (border); SimpleSeriesRenderer r = renderer.getSeriesRendererAt (0); r.setDisplayChalValues (Right); r.setChartValuesTextSize (12); r.setChartValuesSpacing (3); r.setGradientEnabled (true); R.setGradientStart (-20, color. BLUE); R.setGradientStop (20, color. GREEN); Return ChartFactory.getRangeBarChartIntent (Reference, Dataset, Renderer, Type Default, "Temperature Range");  

Is there an error showing that this can help? Thanks.

set render element for each axis (0 or 1) Do what you want:

  Renderer.Creative (cUnits, 0); renderer.setLabelsColor (Color.WHITE); renderer.setXLabelsColor (Color.GREEN); Renderer.setYLabelsColor (0 , Color [0]); & lt;! - left axis - & gt; Renderer.setYLabelsColor (1, color [1]); & lt;! - Correct axis - & gt; Renderer.setYTitle (Dunes, 1 ); Renderer.setYAxisAlign (align. Right, 1); Renderer.setYLabelsAlign (Alright, Wright, 1);  

Comments