Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 46: | Rivi 46: | ||
// add chart container | // add chart container | ||
//memo.widgetEl.append( '<div class="card JwCard mb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header">Otsikko</div><div class="card-body" style="position: relative; width: 100%; height: 350px;"><div class="chart-container" style="position: relative; z-index: 110; width: 100%; height: 100%;"></div></div><div class="card-footer">footer</div></div>' ); | //memo.widgetEl.append( '<div class="card JwCard mb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header">Otsikko</div><div class="card-body" style="position: relative; width: 100%; height: 350px;"><div class="chart-container" style="position: relative; z-index: 110; width: 100%; height: 100%;"></div></div><div class="card-footer">footer</div></div>' ); | ||
memo.widgetEl.append( '<div class="card JwCard mb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header"> | memo.widgetEl.append( '<div class="card JwCard mb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header"></div><div class="card-body p-2" style="position: relative; width: 100%; height: 350px;"><div class="chart-container" style="position: relative; z-index: 110; width: 100%; height: 100%;"></div></div></div>' ); | ||
//memo.widgetEl.append( '<div class="chart-container" style="position: absolute; z-index: 110; width: 100%; height: 100%;"></div>' ); | //memo.widgetEl.append( '<div class="chart-container" style="position: absolute; z-index: 110; width: 100%; height: 100%;"></div>' ); | ||
memo.chartEl = jQuery( this ).find( '.chart-container' ); | memo.chartEl = jQuery( this ).find( '.chart-container' ); | ||
memo.headerEl = jQuery( this ).find( '.card-header' ); | memo.headerEl = jQuery( this ).find( '.card-header' ); | ||
// add title | |||
memo.headerEl.append( '<div class="obscharttitle" style="Xdisplay: none; float: left;"></div>' ); | |||
memo.titleEl = jQuery( this ).find( '.obscharttitle' ); | |||
// add fullscreen button | // add fullscreen button | ||
memo.headerEl.append( '<div class="obschartbutton fullscreen-button" style="display: none; margin-left: 10px; float: right; | memo.headerEl.append( '<div class="obschartbutton fullscreen-button" style="display: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['fullscreen'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none; "><i class="fas fa-expand"></i></button></div>' ); | ||
memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | ||
// add download data button | // add download data button | ||
memo.headerEl.append( '<div class="obschartbutton download-button" style="display: none; margin-left: 10px; float: right; | memo.headerEl.append( '<div class="obschartbutton download-button" style="display: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['download'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-download"></i></button></div>' ); | ||
memo.downloadEl = jQuery( this ).find( '.download-button' ); | memo.downloadEl = jQuery( this ).find( '.download-button' ); | ||
// add edit button | // add edit button | ||
memo.headerEl.append( '<div class="obschartbutton edit-button" style="Xdisplay: none; margin-left: 10px; float: right; | memo.headerEl.append( '<div class="obschartbutton edit-button" style="Xdisplay: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['edit'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-edit"></i></button></div>' ); | ||
memo.downloadEl = jQuery( this ).find( '.download-button' ); | memo.downloadEl = jQuery( this ).find( '.download-button' ); | ||
| Rivi 105: | Rivi 109: | ||
} | } | ||
function drawVisualization( memo ) { | function drawVisualization( memo ) { | ||
if ( typeof i18n[ memo.obscode ].direction != 'undefined' ) { memo.vaxisdir = i18n[ memo.obscode ].direction; } else { memo.vaxisdir = 1; } | if ( typeof i18n[ memo.obscode ].direction != 'undefined' ) { memo.vaxisdir = i18n[ memo.obscode ].direction; } else { memo.vaxisdir = 1; } | ||
// defaults for all charts | // defaults for all charts | ||
memo.options = { | memo.options = { | ||
backgroundColor: 'transparent', | backgroundColor: 'transparent', | ||
chartArea: { backgroundColor: { fill: '#daf0fa', stroke: '#fff', strokeWidth: 6 }}, | chartArea: { backgroundColor: { fill: '#daf0fa', stroke: '#fff', strokeWidth: 6 }}, | ||
| Rivi 388: | Rivi 383: | ||
s = obs.seriesId; | s = obs.seriesId; | ||
if ( typeof memo.seriesO[ s ] == 'undefined' ) { | if ( typeof memo.seriesO[ s ] == 'undefined' ) { | ||
console.log( memo.lang ); | //console.log( memo.lang ); | ||
console.log( i18n[ s ].title[ memo.lang ] ); | //console.log( i18n[ s ].title[ memo.lang ] ); | ||
memo.seriesO[ s ] = { 'id': s, 'title': i18n[ s ].title[ memo.lang ], 'type': 'scatter', 'color': i18n[ s ].color, 'obses': [] }; | memo.seriesO[ s ] = { 'id': s, 'title': i18n[ s ].title[ memo.lang ], 'type': 'scatter', 'color': i18n[ s ].color, 'obses': [] }; | ||
//memo.seriesO[ s + '_trend' ] = { 'type': 'linear', 'obses': [] }; | //memo.seriesO[ s + '_trend' ] = { 'type': 'linear', 'obses': [] }; | ||
| Rivi 503: | Rivi 498: | ||
} | } | ||
/* | /* | ||
// linear trend line | // linear trend line | ||


