Center mark in Bar and HorizBar

TeeChart for PHP
Post Reply
Martin
Newbie
Newbie
Posts: 11
Joined: Tue Nov 13, 2012 12:00 am

Center mark in Bar and HorizBar

Post by Martin » Tue Nov 27, 2012 1:36 pm

Is it possible to center the marks on a Bar and a HorizBar?
And if it is possible how do I do it?

I am using the TeeChartPHP2012.10.08.001_with_Sources version

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

Re: Center mark in Bar and HorizBar

Post by Yeray » Wed Nov 28, 2012 10:23 am

Hi Martin,

MarksOnBar is a feature added in TeeChart VCL quite recently. I've added to the with list the possibility to port it to the PHP version (TF90016436).
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

Martin
Newbie
Newbie
Posts: 11
Joined: Tue Nov 13, 2012 12:00 am

Re: Center mark in Bar and HorizBar

Post by Martin » Wed Nov 28, 2012 10:40 am

Hi Yeray,

So it's not possible right know to center a mark?
How about the Gantt() ? The mark is centered there.
Or does that work different?

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

Re: Center mark in Bar and HorizBar

Post by Yeray » Wed Nov 28, 2012 11:23 am

Hi

In the meanwhile you could calculate and set the marks positions manually. Here you have an example:

Code: Select all

    $chart = new TChart(700,500);    

    $chart->getAspect()->setView3D(false);
    $bar = new Bar($chart->getChart());
    $bar->fillSampleValues();
    $bar->getMarks()->getArrow()->setVisible(false);
    
    $chart->doInvalidate();
    
    for($i=0;$i<sizeof($bar->getMarks()->getPositions());$i++) {
        $p = $bar->getMarks()->getPositions()->getPosition($i);
        if ($p!=null) {
            $p->custom = true;
            $p->leftTop->y = ($chart->getAxes()->getBottom()->getPosAxis() + $bar->calcYPos($i)) / 2;
        }
    }
    
    $chart->render();
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

Martin
Newbie
Newbie
Posts: 11
Joined: Tue Nov 13, 2012 12:00 am

Re: Center mark in Bar and HorizBar

Post by Martin » Wed Nov 28, 2012 11:33 am

They have indeed a custom position.
But not the position I want.
I have the bars 'stacked'.
Does that influence the behavior of the marks?
Attachments
custom_mark_pos.JPG
custom_mark_pos.JPG (35.64 KiB) Viewed 50168 times

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

Re: Center mark in Bar and HorizBar

Post by Yeray » Wed Nov 28, 2012 1:19 pm

Hi Martin,

The different possibilities like Bar/HorizBar series, or the MultiBar style (Stacked,...) should be handled manually while the MarksOnBar feature isn't implemented.
Here you can find an example in VCL where the same was discussed.
http://www.teechart.net/support/viewtop ... bar#p59305
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