[reportlab-users] Specifying chart join axis to intersectpointdoes not draw line below that point

Stevens, Ian IStevens at globeandmail.com
Mon Jul 14 14:09:08 EDT 2008


In case someone needs something like this in future, I did this by:

- extending ScatterPlot and overriding makeBackground() to draw a
crosshair in the center.
- making the min/max values for the chart's value axes to be equal
offsets from the center point such that the second point is still inside
the chart (eg. xValueAxis.valueMin =
centerPoint-abs(otherPoint.x-centerPoint.x))
- setting the avoidBoundFrac on the value axes so that the second point
doesn't rest on the chart box boundary.

Ian.


________________________________

From: reportlab-users-bounces at reportlab.com
[mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Stevens, Ian
Sent: Monday, July 07, 2008 7:40 PM
To: Support list for users of Reportlab software
Subject: Re: [reportlab-users] Specifying chart join axis to
intersectpointdoes not draw line below that point


Is it possible to do this using a Grid and/or axis ticks? (ie.
make the grid or ticks start and end at the center point)

thanks,
Ian.


________________________________

From: reportlab-users-bounces at reportlab.com
[mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Stevens, Ian
Sent: Friday, July 04, 2008 7:50 PM
To: Support list for users of Reportlab software
Subject: [reportlab-users] Specifying chart join axis to
intersect pointdoes not draw line below that point


I need a chart with 2 points on it, with one of the
points centered on the chart intersected by two lines, one parallel to
each axis. The result ishould be like a crosshair centered in the chart
with one point at the center of the crosshair. I've accomplished most of
what I need with ScatterPlot:

centerPointX = ...
centerPointY = ...
plot = ScatterPlot()
[...]
plot.xValueAxis.strokeColor =
plot.yValueAxis.strokeColor = colors.white
plot.xValueAxis.joinAxisMode =
plot.yValueAxis.joinAxisMode = 'value'
plot.xValueAxis.joinAxisPos = centerPointY
plot.yValueAxis.joinAxisPos = centerPointX

This produces a white axis centered on the point, but
the lower half of the y-axis beneath the point is missing. How can I
get the y-axis to descend to the bottom of the chart?

Also, any suggestions as to how I can force the chart to
center itself around the given point?

thanks,
Ian.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080714/477d9081/attachment.html>


More information about the reportlab-users mailing list