File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 16981698 var barColors = { total :"var(--fg)" , edm :"var(--cyan)" , lofi :"var(--amber)" , synthwave :"#ff66cc" } ;
16991699
17001700 if ( daily . length > 0 ) {
1701- var maxSessions = Math . max . apply ( null , daily . map ( function ( d ) { return d . sessions } ) ) || 1 ;
1701+ var maxHours = Math . max . apply ( null , daily . map ( function ( d ) { return d . listen_hours } ) ) || 1 ;
17021702 daily . forEach ( function ( d ) {
1703- var pct = Math . max ( ( d . sessions / maxSessions ) * 100 , 3 ) ;
1703+ var pct = Math . max ( ( d . listen_hours / maxHours ) * 100 , 3 ) ;
17041704 var bar = document . createElement ( "div" ) ;
17051705 bar . className = "radio-chart-bar" ;
17061706 bar . style . height = pct + "%" ;
17071707 bar . style . background = barColors [ stationKey ] || barColors . lofi ;
17081708 bar . style . opacity = "0.7" ;
17091709 var tip = document . createElement ( "div" ) ;
17101710 tip . className = "tooltip" ;
1711- tip . textContent = d . date + " - " + d . sessions + " sessions , "+ d . listen_hours . toFixed ( 1 ) + "h ";
1711+ tip . textContent = d . date + " - " + d . listen_hours . toFixed ( 1 ) + "h , "+ d . sessions + " sessions ";
17121712 bar . appendChild ( tip ) ;
17131713 chart . appendChild ( bar ) ;
17141714 } ) ;
You can’t perform that action at this time.
0 commit comments