shadows

TeeChart for PHP
Post Reply
ISVA7655
Newbie
Newbie
Posts: 16
Joined: Tue Aug 23, 2011 12:00 am

shadows

Post by ISVA7655 » Fri Sep 02, 2011 7:44 pm

I've recently purchased teechart php and I have a many questions. I need to produce a custom graph which involves drawing text on the screen then circumscribing it with either an rectangle or an ellipse.
The annotation tool is a near perfect fit for the rectangle side of that. I have two questions concerning shadows.

1) The annotation tool seems to add a shadow to annotations by default, can this be turned on/off by annotation ?

2) I would like to have the option to add shadows to ellipses and rectangles and any shaps I draw , can this be done ?

Thanks

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: shadows

Post by Yeray » Mon Sep 05, 2011 1:55 pm

Hello,
ISVA7655 wrote:1) The annotation tool seems to add a shadow to annotations by default, can this be turned on/off by annotation ?
Yes, you can do it as follows:

Code: Select all

$annotation1->getShape()->getShadow()->setVisible(false);
ISVA7655 wrote:2) I would like to have the option to add shadows to ellipses and rectangles and any shaps I draw , can this be done ?
You can draw ellipses and rectangles directly to the rendered chart image as follows:

Code: Select all

        $chart1 = new TChart(400,250);

        $bar=new Bar($chart1->getChart());
        $chart1->getChart()->getSeries(0)->setColorEach(true);
        $chart1->getChart()->getSeries(0)->fillSampleValues(10);
                
        $chart1->render("chart1.png");

        $chart1->getChart()->getGraphics3D()->TextOut(10,10,0,"hellooooooooo");
        $chart1->getChart()->getGraphics3D()->getBrush()->SetColor(Color::BLUE());
        $chart1->getChart()->getGraphics3D()->Rectangle(new Rectangle(10,10,100,100)); 
        $chart1->getChart()->getGraphics3D()->getBrush()->SetColor(Color::RED());
        $chart1->getChart()->getGraphics3D()->ellipse(200,200,300,250);

        imagepng($chart1->getChart()->getGraphics3d()->img, "chart1.png");
However, these custom drawing methods don't support shadows, so I'm afraid you should create your own classes to support it. Something like the annotation tool does, that has a Shadow property.
I'll add to the wish list the possibility to add more shape styles for the annotation tool (TF90015724).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply