[reportlab-users] How to break a line graph?
Tim Roberts
timr at probo.com
Tue Jun 26 15:47:45 EDT 2007
David Frank wrote:
> Hi,
>
> I am making a line chart [using HorizontalLineChart()] and I have an
> array of values as the chartdata. Now, one of the arrays has some null
> values in it. Eg.,
>
> chartdata[2] = [100.2, 100.111, 50.2345, 50.0, None, None, None, None,
> None, None, 106.651199, 50.34, 206.651, 1978.788, 39.787, 978.787,
> 18.88, 1.65, 2.99, 2.0]
>
> Now the first 4 values (chartdata[0] to chartdata[3]) and the last 9
> values (chartdata[10] to chartdata[19]) are not 'None' and then the
> rest of the values are None. The graph is required to have a line
> drawn for the first 4 values, then again a line drawn for the last 9
> values. But, in the result, I get a line joining the values
> chartdata[3] and chartdata[10], making it appear to have a set of
> static values between these two values. Using zeros instead of None
> will still not solve the problem since it would appear that the values
> are zeros.
I'm not 100% sure after scanning the code, but it looks like this might
work if you break this yourself:
chartdata[2] = [100.2, 100.111, 50.2345, 50.0, None, None, None, ... ]
chartdata[3] = [None, None, None, None, None, None, None, None,
None, 106.651199, 50.34, ...]
However, the benefit of getting source code is that you can tweak it
yourself. It wouldn't take too much work to make the code behave the
way you want.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the reportlab-users
mailing list