Change bar color in libchart

images php coding issues or problems here.

Moderators: macek, egami, gesf

bojan
New php-forum User
New php-forum User
Posts: 19
Joined: Sun Sep 18, 2011 7:00 am

Change bar color in libchart

Postby bojan » Tue Jan 03, 2012 5:40 am

Hello everyone.

Does anybody know how to change bar color in libchart. I was trying by changibg pallete.php but without success. I got always one color for all bars

This is example code

include "libchart/libchart/classes/libchart.php";

$chart = new VerticalBarChart(800, 350);

$dataSet = new XYDataSet();
$dataSet->addPoint(new Point("Jan 2005", 2545));
$dataSet->addPoint(new Point("Feb 2005", 2321));
$dataSet->addPoint(new Point("March 2005", 442));
$dataSet->addPoint(new Point("April 2005", 711));

$chart->setDataSet($dataSet);

$chart->setTitle("Monthly usage for www.example.com");
$chart->render("generated/demo2.png");

thanks,

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Change bar color in libchart

Postby egami » Wed Jan 04, 2012 6:33 am

After a little bit of a google search, I found it.

bojan
New php-forum User
New php-forum User
Posts: 19
Joined: Sun Sep 18, 2011 7:00 am

Re: Change bar color in libchart

Postby bojan » Wed Jan 04, 2012 8:15 am

I also found it but I have also tried to do that and that isn't worked..so thanks for this useful info.

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Change bar color in libchart

Postby egami » Wed Jan 04, 2012 1:49 pm

Have you thought about asking the developer(s)?


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest