diff --git a/http_src/utilities/graph/dygraph-format.js b/http_src/utilities/graph/dygraph-format.js index 0905003f29ad..83140f838dcd 100644 --- a/http_src/utilities/graph/dygraph-format.js +++ b/http_src/utilities/graph/dygraph-format.js @@ -97,7 +97,10 @@ function getName(ts_info, metadata) { if (ts_info.ext_label) { name = ts_info.ext_label } - return name + if (ts_info.label) { + name = ts_info.label + } + return { timeserie_name: name, show_full_name: (ts_info.label == null) } } /* *********************************************** */ @@ -114,7 +117,7 @@ function getPlotter(chart_type) { function addNewSerie(serie_name, chart_type, color, config) { config.labels.push(serie_name); - if(config.properties == null) + if (config.properties == null) config.properties = {} config.properties[serie_name] = {} config.properties[serie_name] = dygraphConfig.formatSerieProperties(chart_type); @@ -278,8 +281,9 @@ function formatStandardSerie(timeserie_info, timeserie_options, config, tsCompar const ts_id = getSerieId(ts_info); const metadata = timeserie_info.metric.timeseries[ts_id]; const scalar = (metadata.invert_direction === true) ? -1 : 1; - const timeserie_name = getName(ts_info, metadata) - const serie_name = getSerieName(timeserie_name, ts_id, timeserie_info, config.use_full_name) + const { timeserie_name, show_full_name } = getName(ts_info, metadata) + /* Check if show_full_name is null or undefined */ + const serie_name = getSerieName(timeserie_name, ts_id, timeserie_info, (show_full_name !== null || show_full_name !== undefined) ? (config.use_full_name && show_full_name) : config.use_full_name) const avg_name = getSerieName(timeserie_name + " Avg", ts_id, timeserie_info, config.use_full_name) const perc_name = getSerieName(timeserie_name + " 95th Perc", ts_id, timeserie_info, config.use_full_name); const past_name = getSerieName(timeserie_name + " " + tsCompare + " Ago", ts_id, timeserie_info, config.use_full_name); @@ -384,7 +388,7 @@ function formatSimpleSerie(data, serie_name, chart_type, formatters, value_range }); /* To not have an error, just add a null value */ - if(tmp_serie.length == 0) { + if (tmp_serie.length == 0) { tmp_serie.push([1, null]); } @@ -401,14 +405,14 @@ function formatSimpleSerie(data, serie_name, chart_type, formatters, value_range disable_ts_list: true, }; - if (typeof(serie_name) === "string") { + if (typeof (serie_name) === "string") { addNewSerie(serie_name, chart_type, { color: constant_serie_colors["default_color"], palette: 0 }, config) } else { serie_name.forEach((el) => { addNewSerie(el, chart_type, { color: constant_serie_colors["default_color"], palette: 0 }, config) }) } - formatSerieColors(config.colors); + formatSerieColors(config.colors); return dygraphConfig.buildChartOptions(config); } diff --git a/http_src/vue/page-network-configuration.vue b/http_src/vue/page-network-configuration.vue index 094b70fe2532..9d7ef2317333 100644 --- a/http_src/vue/page-network-configuration.vue +++ b/http_src/vue/page-network-configuration.vue @@ -1,9 +1,10 @@