Skip to content

impossible to set backround color #6

@GoogleCodeExporter

Description

@GoogleCodeExporter
I'm trying to get a pie chart with all background gray.

This is the code I'm using:

    $chart = new PieChart();
    $chart->getPlot()->getPalette()->setBackgroundColor(array(
      new Color(50, 50, 50),
      new Color(50, 50, 50),
      new Color(50, 50, 50),
      new Color(50, 50, 50),
    ));
    $chart->getPlot()->setLogoFileName('');

    $dataSet = new XYDataSet();
    $dataSet->addPoint(new Point("A" (0 MB)", 0));
    $dataSet->addPoint(new Point("B" (1874 MB)", 1074));
    $dataSet->addPoint(new Point("C" (1 MB)", 1));
    $chart->setDataSet($dataSet);
    $chart->setTitle("Foo");

    $chart->render('/tmp/foo.png');

The result is a pie with gray background only around the pie itself, but white 
for the rest of image.

Libchart version: 1.3
PHP: 5.4.6
OS: Ubuntu 12.10



Original issue reported on code.google.com by garakkio on 13 Mar 2013 at 10:36

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions