[owtchart-users] Re: OWTChart-I cant set transparent background

Daniel Morissette morissette@dmsolutions.ca
Thu, 27 Nov 2003 12:15:34 -0500


Cristina Amil wrote:
> Hello Daniel, Hello list !!
>  
> Ok, I have set TranspBG=1 in my graphs, but if I write Type=pie, the 
> transparent background is ignored. If I write Type=bar it works!
>  

Um... it seems that there was a bug.  The transparent bg didn't work for 
pie charts. I fixed it here, if you have access to a compiler then you 
can get a copy of the source from the website and make the following 
change to gdchart2/gdc_pie.c (just two lines to add):

--- gdc_pie.c   2001/05/31 15:55:39     1.5
+++ gdc_pie.c   2003/11/27 17:04:59
@@ -361,6 +361,9 @@

      /* --- allocate the requested colors --- */
      BGColor   = clrallocate( im, psGDC->BGColor );
+    if( psGDC->transparent_bg )
+        gdImageColorTransparent( im, BGColor );
+
      LineColor = clrallocate( im, psGDC->LineColor );
      PlotColor = clrallocate( im, psGDC->PlotColor );
      if( psGDC->pie_EdgeColor != GDC_NOCOLOR )


(I apologize in advance for the build environment which isn't very clean 
in the source package... I still haven't had time to clean that up)

> Moreover, the ImageType always is gif althought I had set ImageType=PNG, 
> but it is unimportant for me.
>  

This will work only if your owtchart executable is compiled with a copy 
of GD that supports multiple formats. If it's compiled with GD 1.3 (the 
default) then only GIF is supported.

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               morissette@dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------