[reportlab-users] Controlling exact position of xValueAxis for LinePlot
Robin Becker
robin at reportlab.com
Mon Oct 2 11:13:56 EDT 2017
Hi Luke,
>
> However, I am having trouble finding out how to control the position of
> the X axis labels. If I have a plot with 2 values, the X axis is always
> present at the rightmost position - meaning, it always fills the entire
> length of the plot. How do I control the X axis to only draw some part
> of the righ-to-left length of the plot.
we don't have any way to split a plot horizontally if that's what you are trying
to do. If you are trying to draw the plot in several ranges then that should
work provided you split the data into several xranges (which I presume are
times/dates).
There are several issues in this case.
1) Do you want to plot all the data on the same y-axis range.
2) should the x values have gaps or should the split x-axis be continuous.
1) is relatively easy. If you want one vertical range then plot all the data in
a dummy mode and obtain the vertical max and min your parameter setup is
choosing. You can then apply that to each of the split plots using the yaxis
valueMin/Max attributes.
2) is also relatively easy if you just fix up the data series in whatever
ranges you choose. You will then have to set the x-ticks your self. Again a
single plot mode may be your way out if you plot it large enough the single
dummy plot will have ticks computed for all of its range. If you split those
into the appropriate ranges as for your data then the NormalDateXValueAxis at
least should allow specifying exact ticks using the specifiedTickDates attribute.
If the above seems reasonable then by all means ask if there are bits of such a
strategy that are puzzling.
--
Robin Becker
More information about the reportlab-users
mailing list