[reportlab-users] barLabelFormat for negative numbers

Pat Johnson reportlab-users@reportlab.com
Tue, 19 Nov 2002 16:31:28 -0500


This is a multi-part message in MIME format.

------=_NextPartTM-000-8dbe02cc-3aa1-4837-80f0-608770c8c7ab
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0007_01C28FE9.1C4E4A40"

------=_NextPart_000_0007_01C28FE9.1C4E4A40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I admit I'm a newbie to reportlabs.

The issue is that the graphs I'm trying to make have positive and =
negative data out to 2 decimal places (example  19.33, -12.42, -3.03, =
5.00).  If the data is negative I need to format the bar labels to =
dispaly the value as an absolute value inside parenthesis and red, if =
possible (example (12.42) and (3.03)).  If the number is postivie, =
display the number as is, in black.

The only examples I've been able to find in the documentation and on the =
web have simplistic examples like '%d' and '$%d'.  I did find one =
discussion about def_formatHour(self, seconds) but didn't understand =
it...didn't get what the "3D" was all about.

Can anyone help me, please.

Thanks so much

Pat Johnson
patricia.johnson@fmr.com
------=_NextPart_000_0007_01C28FE9.1C4E4A40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4915.500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I admit I'm a newbie to =
reportlabs.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The issue is that the graphs I'm trying =
to=20
make&nbsp;have positive and negative data out to 2 decimal places =
(example&nbsp;=20
19.33, -12.42, -3.03, 5.00).&nbsp; If the data is negative I need to =
format the=20
bar labels to dispaly the value as an absolute value inside parenthesis =
and red,=20
if possible (example <FONT color=3D#ff0000>(12.42)</FONT> and <FONT=20
color=3D#ff0000>(3.03)</FONT>).&nbsp; If the number is postivie, display =
the=20
number as is, in black.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The only examples I've been able to =
find in the=20
documentation and on the web have simplistic examples like '%d' and =
'$%d'.&nbsp;=20
I did find one discussion about def_formatHour(self, seconds) but didn't =

understand it...didn't get what the "3D" was all about.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone help me, =
please.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks so much</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Pat Johnson</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"mailto:patricia.johnson@fmr.com">patricia.johnson@fmr.com</A></FO=
NT></DIV></BODY></HTML>

------=_NextPart_000_0007_01C28FE9.1C4E4A40--


------=_NextPartTM-000-8dbe02cc-3aa1-4837-80f0-608770c8c7ab--