[reportlab-users] barLabelFormat for negative numbers

Andy Robinson reportlab-users@reportlab.com
Fri, 22 Nov 2002 12:43:45 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_002A_01C29224.CBD495E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Have replied to Pat privately, but we're working on an extension to do this
and hope to add something in soon.

- Andy
  -----Original Message-----
  From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of Pat Johnson
  Sent: 19 November 2002 21:31
  To: reportlab-users@reportlab.com
  Subject: [reportlab-users] barLabelFormat for negative numbers


  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_002A_01C29224.CBD495E0
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 6.00.2479.6" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D149173712-22112002><FONT face=3DArial color=3D#0000ff =
size=3D2>Have=20
replied to Pat privately, but we're working on an extension to do=20
this</FONT></SPAN></DIV>
<DIV><SPAN class=3D149173712-22112002><FONT face=3DArial color=3D#0000ff =
size=3D2>and=20
hope to add something in soon.</FONT></SPAN></DIV>
<DIV><SPAN class=3D149173712-22112002><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D149173712-22112002><FONT face=3DArial color=3D#0000ff =
size=3D2>-=20
Andy</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  reportlab-users-admin@reportlab.com=20
  [mailto:reportlab-users-admin@reportlab.com]<B>On Behalf Of </B>Pat=20
  Johnson<BR><B>Sent:</B> 19 November 2002 21:31<BR><B>To:</B>=20
  reportlab-users@reportlab.com<BR><B>Subject:</B> [reportlab-users]=20
  barLabelFormat for negative numbers<BR><BR></FONT></DIV>
  <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=20
  (example&nbsp; 19.33, -12.42, -3.03, 5.00).&nbsp; If the data is =
negative I=20
  need to format the bar labels to dispaly the value as an absolute =
value inside=20
  parenthesis and red, if possible (example <FONT =
color=3D#ff0000>(12.42)</FONT>=20
  and <FONT color=3D#ff0000>(3.03)</FONT>).&nbsp; If the number is =
postivie,=20
  display the 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=20
  '$%d'.&nbsp; I did find one discussion about def_formatHour(self, =
seconds) but=20
  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></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_002A_01C29224.CBD495E0--