Page 1 of 1

Center mark in Bar and HorizBar

Posted: Tue Nov 27, 2012 1:36 pm
by 15964102
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

Re: Center mark in Bar and HorizBar

Posted: Wed Nov 28, 2012 10:23 am
by yeray
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).

Re: Center mark in Bar and HorizBar

Posted: Wed Nov 28, 2012 10:40 am
by 15964102
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?

Re: Center mark in Bar and HorizBar

Posted: Wed Nov 28, 2012 11:23 am
by yeray
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();

Re: Center mark in Bar and HorizBar

Posted: Wed Nov 28, 2012 11:33 am
by 15964102
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?

Re: Center mark in Bar and HorizBar

Posted: Wed Nov 28, 2012 1:19 pm
by yeray
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