Adrielpin / gchartphp

Automatically exported from code.google.com/p/gchartphp
0 stars 0 forks source link

Multiple Colors for bar chart not accepted. It's only allowing one. #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a bar chart with one data series of many values
2. Assign colors for each data point
3. Notice how only the first color is taken if using the setColors function.

I'm trying to recreate this chart:
https://chart.googleapis.com/chart?cht=bvg&chs=1000x125&chxt=x,y,x,y&chxr=1,-1.5
,1.5&chds=-1.5,1.5&chxp=1,-1,0,1|2,50|3,50&chbh=30,50,12&chxl=0:|NO/Min|Mia/Buf|
Chi/Det|Ten/Oak|NE/Cin|NYG/Car|Atl/Pit|TB/Cle|Jac/Den|Ind/Hou|Ari/StL|GB/Phi|SF/
Sea|Dal/Was|NYJ/Bal|SD/KC|1:|Incorrect|Push|Correct|2:|Week 
1|3:|John&chco=00FF00|00FF00|FF0000|999999|FF0000|00FF00|00FF00|FF0000|FF0000|FF
0000|999999|FF0000|00FF00|00FF00|00FF00|999999&chxs=3,FF0000,13,0,t|2,0000FF,13,
0,t&chd=t:1,1,-1,0.1,-1,1,1,-1,-1,-1,0.1,-1,1,1,1,0.1&chm=t5,000000,0,0,10,,e|t3
,000000,0,1,10,,e|t6.5,000000,0,2,10,,e|t6.5,000000,0,3,10,,e|t4.5,000000,0,4,10
,,e|t6.5,000000,0,5,10,,e|t2.5,000000,0,6,10,,e|t3,000000,0,7,10,,e|t2.5,000000,
0,8,10,,e|t2.5,000000,0,9,10,,e|t4,000000,0,10,10,,e|t3,000000,0,11,10,,e|t3,000
000,0,12,10,,e|t3.5,000000,0,13,10,,e|t2.5,000000,0,14,10,,e|t4.5,000000,0,15,10
,,e

What is the expected output? What do you see instead?
The bar colors should change with setColors. But instead only the first color 
is taken and applied to all the data points in the first series.

What version of the product are you using? On what operating system?
The latest version as of 4/11/2011

Please provide any additional information below.
This is the syntax I'm using $barChart->setColors(array("FF0000", "00FF00", 
"FF0000"....

Original issue reported on code.google.com by jkur...@gmail.com on 12 Apr 2011 at 11:14

GoogleCodeExporter commented 8 years ago
I just entered the chart.googleapis.com URL into my browser and the colors look 
OK to me. First two are green, third is red, fourth is grey, fifth is red, etc.

Nick

Original comment by nick.mal...@gmail.com on 3 Sep 2011 at 3:11

GoogleCodeExporter commented 8 years ago
I think that you have to use this command to set the colors:

$yourChart->setColors = setColors(array("FF0000", "00FF00", "FF0000"....

Original comment by bardellie on 3 Sep 2011 at 5:29