I want to place the x-axis line and y-axis line in the middle of the plot not in the extreme corners .Is there any way do that and please tell how to do that.
To be more precise i need to move the x-axis and y-axis line in the XYchart.
Setting the X-Axis and Y-axis Line
-
- Posts: 24
- Joined: Wed May 16, 2007 8:20 am
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The axis labels are always drawn at the edges of the chart, but if you'd like to highlight the zero baselines in the plot, you can call XYPlot.setDomain/RangeZeroBaselineVisible(boolean)...plus related methods to control the paint and stroke.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I think tomkieffer means that if you do something like:
then the y value of 0.0 will appear in the middle of the chart. Likewise for the x-axis. I don't know if that solves your problem or not.
Code: Select all
yAxis.setRange(-5.0, 5.0)
then the y value of 0.0 will appear in the middle of the chart. Likewise for the x-axis. I don't know if that solves your problem or not.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


what if you have a CategoryPlot...david.gilbert wrote:The axis labels are always drawn at the edges of the chart, but if you'd like to highlight the zero baselines in the plot, you can call XYPlot.setDomain/RangeZeroBaselineVisible(boolean)...plus related methods to control the paint and stroke.
the CategoryPlot class doesnt have setDomain/RangeZeroBaselineVisible(boolean)... methods...
is there a way to achieve the same thing if you have a categoryplot and bar chart?