Charts resizing themselves
Charts resizing themselves
mfhawley
Posts: 4Questions: 2Answers: 0
I am using google visualizer alongside some show/hide code to display 3 different charts at the same time (top of home page. However, the 2 of the 3 charts are resizing themselves (weekly and monthly) when they should be all the same size as daily.
How can I fix this? I use google visualizer wordpress plugin with a bit of added code (hence the shortcodes)
URL in concern: http://www.lowfloatindex.com
Function code added to header file:
<script>
var divs = ["Daily", "Weekly", "Monthly"];
var visibleDivId = null;
function toggleVisibility(divId) {
if(visibleDivId === divId) {
visibleDivId = divId;
} else {
visibleDivId = divId;
}
hideNonVisibleDivs();
}
function hideNonVisibleDivs() {
var i, divId, div;
for(i = 0; i < divs.length; i++) {
divId = divs[i];
div = document.getElementById(divId);
if(visibleDivId === divId) {
div.style.display = "block";
} else {
div.style.display = "none";
}
}
}
</script>
Code in text tab of page editor:
<div class="inner_div">
<div id="Daily">[visualizer id="431"]</div>
<div id="Weekly" style="display: none;">[visualizer id="430"]</div>
<div id="Monthly" style="display: none;">[visualizer id="429"]</div>
</div>
<div class="main_div">
<div class="buttons" align="center">
 
<button href="#" onclick="toggleVisibility('Daily');">Daily</button> <button href="#" onclick="toggleVisibility('Weekly');">Weekly</button> <button href="#" onclick="toggleVisibility('Monthly');">Monthly</button>
</div>
This discussion has been closed.
Answers
I'm not sure how this relates to DataTables? This is a DataTables forum, not a general Javascript help forum.
Allan