+ if ($gmeta['legends_long'] && (!isset($pconf['show_legend']) || $pconf['show_legend'])) {
+ $out .= '<div class="legend">';
+ $out .= '<p>'.$ltitle.'</p>';
+ $out .= '<table class="legend">';
+ foreach ($gmeta['legend'] as $field=>$legend) {
+ if (strlen($legend['desc_long'])) {
+ $out .= '<tr><th';
+ if ($colorize_data && isset($gmeta['legend'][$field])) {
+ $out .= ' style="color:'.$gmeta['legend'][$field]['color'].';';
+ if (strlen($gmeta['legend'][$field]['color_bg'])) {
+ $out .= 'background-color:'.$gmeta['legend'][$field]['color_bg'].';';
+ }
+ $out .= '"';
+ }
+ $out .= '>'.$field.'</th>';
+ $out .= '<td>'.$legend['desc_long'].'</td>';
+ $out .= '</tr>';
+ }
+ }
+ $out .= '</table>';
+ $out .= '</div>';
+ }