Good Day To All I'm new to pCharts, works great! I'm trying to create a bar chart with 2 thresholds and display different bar colors. Setting the thresholds is done and works well. Now I would like to set the standard palette to a set color and only the bars that exceed the specified second threshold should be a different color. My data consists of times file were imported So in theory, if possible, all bars exceeding the 2nd limit should be red or pink or whatever. Is this possible? If so, where do I start fiddling? I have tried OverideColors with an if statement but it seems not to work so well. Any info would be very helpful. Thanks
Asked
Active
Viewed 1,065 times
1
-
Found the solution, banged around with the code – kirchner20 Aug 20 '13 at 13:06
-
Could you post your solution for others to see as well? Would be very useful! – Kaiesh Aug 29 '13 at 03:05
1 Answers
1
Ok, so here is the code. I know there might be better or cleaner ways of doing it but this works:
/*Palette per Bar*/
$thold = strtotime("09:30:00");
foreach ($lastdate as $over) {
if ($over < $thold) {
$color = array("R"=>0,"G"=>204,"B"=>204);
$Palette[] = $color;
}
else {
$color2 = array("R"=>224,"G"=>46,"B"=>117);
$Palette[] = $color2;
}
}
Hope this helps

kirchner20
- 97
- 1
- 11