I have task is chart in picture.
My problem is how to add Y Axis in right same PDF in picture.
please tell me how to do that.
Thank for watching!
Your second line chart will have to use a different scale and the Y axis align for the second scale must be on the right. Take a look at this example for a working piece of code. The example builds a chart like the one below.
Related
I am working and android chart library using MPAndroidChart .
I am using HorizontalBarChart to display chart.
Please see the attached image and I want do decrease x axis width or want to display x axis text in two lines is there any way to this ?
Any help will get appreciate.
There is currently no way to draw the x-axis labels in multiple lines.
What you can do to decrease the space the labels consume is to simply provide shorter labels. A axis label of the length you are showing above is too long for a chart to be easily readable anyway.
I'm using GraphView to draw graphs in my android app, but I'm not able to set axis labels on the X and Y axis which denote what they represent. I checked the documentation, but couldn't find anything useful. How can I do it?
you're right. there is no build in method to do it. You have to place your label views yourself at the left resp. bottom of the graphview. This can be done for example with RelativeLayout.
I'm having trouble getting AChartEngine to center the actual visible axises on Origo instead of having them along the left- and bottom of the chart.
I need to have the axises like so:
Any ideas?
(This question is similar to question #2 [2]: Make x-axis in vertical center using AChartEngine but I thought that a more specific question might get an answer)
I made some modifications to AChartEngine 1.0.0 to make it possible to display axises in the center of the plot.
Use code below to set the axises to center.
XYMultipleSeriesRenderer.setXAxisAlign(Align.CENTER, 0);
XYMultipleSeriesRenderer.setYAxisAlign(Align.CENTER, 0);
XYMultipleSeriesRenderer.patch
XYChart.patch
And here is an example on how it may look
There isn't a better answer than the one you mentioned. Just make sure that you calculate X and Y ranges such as your data fits inside and also make sure that the range you set is centered on the 0 point:
renderer.setXAxisMin(-value);
randerer.setXAxisMax(value);
and the same for the Y axis.
I'm using achartengine to show a temperature graph. on X axis I put dates, to fit them I call setXLabelsAngle(45); this is the result:
As you can see, the labels are placed too high and go over the x-Axis. How could I fix this? I'm already using setMargins(), but labels don't move, only legend does.
This will help:
renderer.setXLabelsAlign(Align.LEFT);
I am able to display the AChartEngine's TimeChartView to user, but when the graph renders, the grid lines (vertical - set by showGridLines(true)) and the line drawn on graph to display corresponding y-axis value (time in secs) against the dates on x-axis don't intersect with each other.
The y-axis value pt shows up either before the x-axis value or after it, but not exactly on it.
Please suggest, if there's any achartengine property which needs to be set to get this done / any other thing that needs to be done for getting this done.
Thanks
Omkar Ghaisas
Sample Image --
As can be seen, the points marked with ovals don't coincide with the vertical grid lines and with x axis values, but start before that. E.g the first y value for 7200 should start at vertical line of 02/03/2012, but instead starts before that. Similarly for all other data points.
This was fixed in the AChartEngine SVN.
Please see this for extra information.