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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top