Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-8959

Fix Color Selection In SVG Graph When Aggregating by Whole Dataset

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 6.0.25, 6.4.10, 7.0.0alpha9
    • Frontend (F)
    • None

      When multiple items are chosen in the Svg Graph and are aggregated by the whole dataset, the first result from the function getColorVariations becomes the color of the aggregated data set. This is confusing and can lead to unexpected colors in the graph.

       

      For whole data set aggregations the original color choice should be used from $options['data_sets'].

       

      For example, in getMetricsAggregatedData(), starting at line 701, some simple logic could be added to easily fix this:

      699                                 if ($metric['options']['aggregate_grouping'] == GRAPH_AGGREGATE_BY_DATASET) {
       700                                         $dataset_metrics[$dataset_num] = $metric_num;
       701                                         if ($data_sets[$dataset_num]['dataset_type'] == CWidgetFieldDataSet::DATASET_TYPE_PATTERN_ITEM) {
       702                                                 $metric['options']['color'] = '#' . $data_sets[$dataset_num]['color'];
       703                                         }
       704                                         else {
       705                                                 $metric['options']['color'] = '#' . $data_sets[$dataset_num]['color'][0];
       706                                         }
       707                                 }

            vmurzins Valdis Murzins
            GRyan337 Ryan Eberly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: