'Couleur '.$i,'type'=>'color'); } return $options; } public static function toHtml($label,$data,$options){ require_once(__DIR__.SLASH.'..'.SLASH.'View.class.php'); if(!isset($options['properties'])) $options['properties'] = array(); $html = ''; try{ $data = $data['data']; $colors = View::colorSet(); shuffle($colors); $colorNumber = 0; foreach($options['properties'] as $key=>$value){ if(strpos( $key,'color-')===false || empty($value)) continue; $colors[$colorNumber] = $value; $colorNumber++; } $background = implode('","',$colors); $keys = array_keys($data); $values = array_values($data); if(count($data)==0) throw new Exception("
array( 'Légende 1' => 12, 'Légende 2' => 14, 'Légende 3' => 15 );"); if(isset($label)) $html.='