component/UIChartController.js
/* 
    High light the button corresponding to the active nDays
*/
High light the button corresponding to the active nDays
High light the button corresponding to the active nDays
async function updateChartSubtitle() {
    let _cp = document.getElementById("chartViewOptions").getElementsByTagName("button")
    for (let index = 0; index < _cp.length; index++) {
        const element = _cp[index];
        element.disabled = false;
        element.classList.remove("button-active");
    }
    let selectedId = "view-week";
    switch (_nDays) {
        case 1:
            selectedId = "view-day";
            break;
        case 30:
            selectedId = "view-month";
            break;
        default:
            selectedId = "view-week";
            break;
    }
    let _curr = document.getElementById(selectedId);
    _curr.classList.add("button-active");
    _curr.disabled = true;
}
async function updateChartSubtitle ( ) { let _cp = document . getElementById ( "chartViewOptions" ) . getElementsByTagName ( "button" ) for ( let index = 0 ; index < _cp . length ; index ++ ) { const element = _cp [ index ] ; element . disabled = false ; element . classList . remove ( "button-active" ) ; } let selectedId = "view-week" ; switch ( _nDays ) { case 1 : selectedId = "view-day" ; break ; case 30 : selectedId = "view-month" ; break ; default : selectedId = "view-week" ; break ; } let _curr = document . getElementById ( selectedId ) ; _curr . classList . add ( "button-active" ) ; _curr . disabled = true ; }
High light the button corresponding to the active nDays
High light the button corresponding to the active nDays