'Afficher les légendes','type'=>'boolean'); for($i=0;$i<10;$i++){ $options['color-'.$i] = array('label'=>'Couleur '.$i,'type'=>'color'); } return $options; } public static function toHtml($label,$data,$options = array()){ $html = ''; if(!isset($options['properties'])) $options['properties'] = array(); 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.='