Ero sivun ”Widget:Ice situation graph” versioiden välillä
Järvi-meriwikistä
(Kumottu muokkaus 873012, jonka teki Molindho (keskustelu)) Merkkaus: Kumoaminen |
|||
Rivi 16: | Rivi 16: | ||
function <!--{$id|default:drawIceSitChart|escape:'html'}-->_func() { | function <!--{$id|default:drawIceSitChart|escape:'html'}-->_func() { | ||
− | + | var id = "<!--{$id|default:drawIceSitChart|escape:'html'}-->"; | |
var siteName = '<!--{$page|escape:'urlpathinfo'}-->'; | var siteName = '<!--{$page|escape:'urlpathinfo'}-->'; | ||
var lang = '<!--{$lang|default:fi|escape:'urlpathinfo'}-->'; | var lang = '<!--{$lang|default:fi|escape:'urlpathinfo'}-->'; | ||
Rivi 340: | Rivi 340: | ||
backgroundColor: { fill:'transparent' }, | backgroundColor: { fill:'transparent' }, | ||
crosshair: { trigger: 'both' }, | crosshair: { trigger: 'both' }, | ||
− | chartArea: { top: 10, left: 80, width: (jQuery('# | + | chartArea: { top: 10, left: 80, width: (jQuery('#' + id + '_ice_chart_div').width() - 80 - 20), height: (jQuery('#' + id + '_ice_chart_div').height() - 50 - 10), backgroundColor: { stroke: '#ccc', strokeWidth: 1, fill: '#daf0fa' } }, |
tooltip: { isHtml: true } | tooltip: { isHtml: true } | ||
}; | }; | ||
− | var chart = new google.visualization.ComboChart(document.getElementById(' | + | var chart = new google.visualization.ComboChart(document.getElementById(id + '_ice_chart_div')); |
chart.draw(dataTable, options); | chart.draw(dataTable, options); | ||
jQuery( window ).resize(function() { | jQuery( window ).resize(function() { | ||
− | + | options.chartArea.width = (jQuery('#' + id + '_ice_chart_div').width() - 80 - 20); | |
− | options.chartArea.width = (jQuery('# | + | options.chartArea.height = (jQuery('#' + id + '_ice_chart_div').height() - 50 - 10); |
− | options.chartArea.height = (jQuery('# | ||
chart.draw(dataTable, options); | chart.draw(dataTable, options); | ||
}); | }); | ||
Rivi 419: | Rivi 418: | ||
<!--Div that will hold the pie chart--> | <!--Div that will hold the pie chart--> | ||
− | <div style="Xbackground-color: #c1e7f7; height: 300px;" id=" | + | <div style="Xbackground-color: #c1e7f7; height: 300px;" id="<!--{$id|default:drawIceSitChart|escape:'html'}-->_ice_chart_div"></div> |
</includeonly> | </includeonly> |