Perhaps this has been answered already and I can't find what I need because I am searching incorrectly.
I am trying to create a graph like this one.
I can't figure out what I need to adjust to make the LineChart domain plotting start on the x-axis as shown. How do I eliminate the padding in place before (and after) the first point is plotted? My graph looks like the one below:
I suspect I might need create my own custom Axis (as I only want to adjust the spacing before the first tick mark and after the last) and that is fine. I'm just not sure what exactly in particular to change in there to achieve my end goal.
Thank you for any ideas!
Line Chart - Adjusting padding for first/last tick marks
-
- Posts: 45
- Joined: Thu Jun 26, 2014 8:24 am
- antibot: No, of course not.
- Location: Germany, Aachen
Re: Line Chart - Adjusting padding for first/last tick marks
Hey!
forget this, I thought you were using normal XYPlot.
Greetings
forget this, I thought you were using normal XYPlot.
Greetings
Last edited by Naxter on Thu Feb 04, 2016 2:34 pm, edited 1 time in total.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Line Chart - Adjusting padding for first/last tick marks
You can set the lower and upper margins on the axis to 0.0, but you will still be left with half a category width at each end.
In a future release, I will probably add 'firstCategoryHalfWidth' and 'lastCategoryHalfWidth' flags to give some control over this (it's already done that way in Orson Charts), but for now there is no way to completely eliminate that gap unfortunately.
In a future release, I will probably add 'firstCategoryHalfWidth' and 'lastCategoryHalfWidth' flags to give some control over this (it's already done that way in Orson Charts), but for now there is no way to completely eliminate that gap unfortunately.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Line Chart - Adjusting padding for first/last tick marks
An alternative would be to switch to an XYPlot, then you can eliminate the margins but you would have to customise the formatting of the date axis.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Line Chart - Adjusting padding for first/last tick marks
Thanks for the response.
I'll try the adjustment you suggested and see if they are OK with it before switching to an XYPlot. We actually have a graph already using an XYPlot has a look similar to what I want. That's why I thought it was possible with LineChart.
Now I can stop beating my head against the wall at least!
Thanks again!
I'll try the adjustment you suggested and see if they are OK with it before switching to an XYPlot. We actually have a graph already using an XYPlot has a look similar to what I want. That's why I thought it was possible with LineChart.
Now I can stop beating my head against the wall at least!
Thanks again!