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);
})