Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for Charts #76

Closed
chuebert opened this issue Dec 29, 2014 · 24 comments
Closed

Options for Charts #76

chuebert opened this issue Dec 29, 2014 · 24 comments

Comments

@chuebert
Copy link

Hi,

it is possible to have charts like this:
https://dl.dropboxusercontent.com/u/6242507/charts.png

In the left chart i want have the values on the left line and not by the points.
In the secon chart i want no paddings in the cake.

and it is possible to use percent by countet value or must i calculate it by my self?

@Progi1984
Copy link
Member

@chuebert :

For labels hidden on the points,

$series = new Series('Downloads', $seriesData);
$series->setShowValue(false);

For the padding of the explosion of the pie3d, I add a option (cf. Sample_07.php l.135).

For defining values as percent,

$series = new Series('Downloads', $seriesData);
$series->setShowPercentage(true);

@Progi1984 Progi1984 added this to the 0.4.0 milestone Dec 30, 2014
@Progi1984 Progi1984 self-assigned this Dec 30, 2014
@chuebert
Copy link
Author

Okay thank you very much, it works fine :)

@Progi1984
Copy link
Member

@chuebert Have you the last version of the develop branch ?

l.135 : 85d60c3#diff-e264001d18a8efadcb0fd9fa04610a88R135

@chuebert
Copy link
Author

Yes i have it now, but the $pie3DChart->setExplosion(10); doesnt change anything

@Progi1984
Copy link
Member

$pie3DChart->setExplosion(0);

screenshot148

$pie3DChart->setExplosion(10);

screenshot149

$pie3DChart->setExplosion(20);

screenshot150

@chuebert
Copy link
Author

okay thank you ;)

@Progi1984
Copy link
Member

@chuebert After your tests, if it's ok for you, I will close this issue. Thanks for advance.

@Progi1984
Copy link
Member

@chuebert It's ok for you ?

@chuebert
Copy link
Author

Now i have this:
https://dl.dropboxusercontent.com/u/6242507/charts.jpg

the explosion doesnt work, why?
On linechart i have no values on the left. It is possible to set them?

Here is my code:

        public function createChartSlide($slide, $tonalityData, $matchesData) {

        /* CREATE TEXT */
        $shape = $slide->createRichTextShape();
        $shape->setHeight(200);
        $shape->setWidth(640);
        $shape->setOffsetX(20);
        $shape->setOffsetY(100);
        $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);

        if ($this->user_id != 11 && $this->user_id != 17) {
            $textRun = $shape->createTextRun('Zusammenfassung');
            $textRun->getFont()->setBold(false);
            $textRun->getFont()->setSize(28);
            $textRun->getFont()->setColor(new Color($this->defaultTextColor));
        }

        /* Create a pie chart (that should be inserted in a shape) */
        $pie3DChart = new Pie3D();
        $pie3DChart->setExplosion(0);
        $series = new Series('Downloads', $tonalityData);
        $series->setShowPercentage(true);
        $series->setShowSeriesName(false);
        $series->getDataPointFill(0)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF4672A8'));
        $series->getDataPointFill(1)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF8AA64F'));
        $series->getDataPointFill(2)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFAB4744'));
        $pie3DChart->addSeries($series);

        /* Create a shape (chart) */
        $shape = $slide->createChartShape();
        $shape->setName('tonalität')
                ->setResizeProportional(false)
                ->setHeight(360)
                ->setWidth(500)
                ->setOffsetX(520)
                ->setOffsetY(300);
        $shape->getTitle()->setText('Tonalität der Beiträge');
        $shape->getTitle()->getFont()->setItalic(true);
        $shape->getTitle()->getOffsetX(300);
        $shape->getPlotArea()->setType($pie3DChart);
        $shape->getView3D()->setRotationX(40);
        $shape->getView3D()->setPerspective(10);
        $shape->getLegend()->getBorder()->setLineStyle(Border::LINE_SINGLE);
        $shape->getLegend()->getFont()->setItalic(true);

        /* Create a line chart (that should be inserted in a shape) */
        $lineChart = new Line();
        $series = new Series('', $matchesData);
        $series->setShowValue(false);
        $series->setShowSeriesName(true);
        $lineChart->addSeries($series);

        /* Create a shape (chart) */
        $shape = $slide->createChartShape();
        $shape->setName('Trefferhäufigkeit')
                ->setResizeProportional(false)
                ->setHeight(360)
                ->setWidth(460)
                ->setOffsetX(40)
                ->setOffsetY(300);
        $shape->getTitle()->setText('Trefferhäufigkeit der Beiträge');
        $shape->getTitle()->getFont()->setItalic(true);
        $shape->getPlotArea()->setType($lineChart);
        $shape->getView3D()->setRotationX(30);
        $shape->getView3D()->setPerspective(30);
        $shape->getLegend()->getBorder()->setLineStyle(Border::LINE_SINGLE);
        $shape->getLegend()->getFont()->setItalic(true);
    }

@chuebert
Copy link
Author

How can i remove the legend on line chart? ;)

@Progi1984
Copy link
Member

@chuebert

  • For the explosion, have you the last version of the develop branch with modifications on PowerPoint2007 Writer ? Because I have no problem here.
  • For lineChart and values on left, I have a bug. If you have PowerPoint, could you send me a PPTX with a slide with a line chart with values on Y axis and a slide with a line chart with no values on Y axis, please ?
  • For disabling the legend :
$shape->getLegend()->setVisible(false);

@chuebert
Copy link
Author

[DELETE]

@Progi1984
Copy link
Member

@chuebert I think you have sent me a PHPPowerPoint generated file. I need an Office PowerPoint generated file for having the right XML and find the difference with PHPPowerPoint.

@chuebert
Copy link
Author

ah okay ;)

@chuebert
Copy link
Author

[DELETE]

@chuebert
Copy link
Author

I have update my phppowerpoint folder again and now it works ;)
Only the linechart with values on the left doesnt work, thank you for solving the problem ;)

@Progi1984
Copy link
Member

For the lineChart with values, you must define the format because there are values :

$shape->getPlotArea()->getAxisY()->setFormatCode('#,##0');

Progi1984 added a commit that referenced this issue Dec 31, 2014
Progi1984 added a commit that referenced this issue Dec 31, 2014
@chuebert
Copy link
Author

Thank you very much, its working fine :) Happy New Year ;)

@Progi1984
Copy link
Member

Thanks :)

@manikrds
Copy link

manikrds commented Jan 7, 2015

Hi

Is it possible to have chart like this ?

microsoft powerpoint - template reporting mensuel 2014 - facebook ppt compatibility mode _2

@Progi1984
Copy link
Member

@manikrds At the moment, no.

You can have line charts but without arrow and top legend.

@manikrds
Copy link

manikrds commented Jan 7, 2015

@Progi1984 Thanks for your comment

@manikrds
Copy link

manikrds commented Jan 8, 2015

@Progi1984 Sorry for the same question.

Is Possible to have graph chart like this ??

graph

@Progi1984
Copy link
Member

@manikrds At the moment, no.

You can have line charts but without filling zone under.

If you want implementation, create an issue for each feature which miss you in PHPPowerPoint.

@PHPOffice PHPOffice locked and limited conversation to collaborators Jan 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants