changed selection label to unit in graphics

This commit is contained in:
l_samenv
2024-08-19 16:27:19 +02:00
parent fa88f374fd
commit 6ebcacdf12
3 changed files with 8 additions and 2 deletions

View File

@ -328,6 +328,7 @@ let graphs = (function (){
*/
function createSelection(gindex){
let graph_elm = graph_elm_array[gindex];
console.log("clear for createSelection", gindex)
clear(gindex);
let selection = document.createElement('div');
@ -405,6 +406,7 @@ let graphs = (function (){
* @param {{tag:string, unit:string, curves:[{name:string, label:string, color:string, original_color:string}]}} block - The information of the block to create
*/
function createGraph(gindex, block){
console.log("clear for create graph", gindex)
clear(gindex);
tag_dict[block.tag] = gindex;
let dict = {} // {string: [name:string, label:string, color:string, original_color:string]}
@ -1201,6 +1203,9 @@ let graphs = (function (){
jumpToDate: jumpToDate,
initGraphs: initGraphs,
onZoomCompleteCallback:onZoomCompleteCallback,
prev_blk:prev_blk,
tag_dict:tag_dict
}
})();
@ -1216,7 +1221,7 @@ function Graph(gindex, container, x_label, y_label, tag, scaleType = "linear"){
let dselect = document.createElement('div'); //the clickable unit to select the curves we want to display
dselect.classList.add('dselect');
dselect.innerHTML = "[" + tag + "]";
dselect.innerHTML = "[" + y_label + "]";
dselect.addEventListener('click', function(e){
graphs.createSelection(gindex);
})

View File

@ -452,7 +452,7 @@ class InfluxDataGetter:
variable ({"name":(str), "label":(str), "unit":(str)[,"has_potential_target":(bool)]}) : a dictionnary containing the Influx name of the corresponding variable out of the setup_info dict,
the label to display in the Web GUI, its unit and possibly a boolean value indicating if the variable has a target available.
"""
key = variable["cat"]+variable["unit"]
key = variable["cat"]+"_"+variable["unit"] if variable["cat"] != "" else variable["unit"]
if key not in groups.keys():
groups[key] = {"tag":key, "unit":variable["unit"], "curves":[]} #tag is set to cat+unit while client is not modified
groups[key]["curves"].append({

View File

@ -1,3 +1,4 @@
[chart]
T_stat=other
T_stat.raw=
T_nvd.raw=