Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anwarbham
Contributor III
Contributor III

how to call window.onload in Qlik extension

I am currently using a google timeline extension created by Kai Hilton-Jones
and Improved by Tim Payne,Vojta Plzak, Simone Silini called reboot timeline

i wanted to hide the bottom axis and created a javascript function 

 

function hideTimebar() {
//hide the bottom time bar and main title above
var ab = document.getElementById('defs').nextSibling;
var ac = ab.nextSibling;
ac.style.display = 'none';

var ad = document.getElementsByClassName('qv-object-title qvt-visualization-title')
ad[0].style.display = 'none';
}

 

i want to call this everytime the page is loaded 

on a webpage id use window.load but i dont know were to place the call.

i know the function works because i can call function from IE and it hides the Axis.

Any Help will be appreciated

Labels (2)
1 Solution

Accepted Solutions
anwarbham
Contributor III
Contributor III
Author

got it working you add it after the google events listener 

google.visualization.events.addListener(chart, 'select', function(e)
 
like below the hideTimebar(); changes the css
this goes in the googletimeline.js file if it helps anyone
 

 

google.visualization.events.addListener(chart, 'select', function(e) {
				var sel = chart.getSelection();
				//console.log('boom');
				tim=sel;
				//sel.forEach(function(val) {
					
					selections[0]=elemNos[sel[0].row]
					self.selectValues(0, selections, true);
				//});
				//chart.setSelection(tim);
				//selections = selections.concat(sel);
			});
			//chart.setSelection([]);
			
				//new listener
			hideTimebar();
			

 

View solution in original post

5 Replies
anwarbham
Contributor III
Contributor III
Author

got it working you add it after the google events listener 

google.visualization.events.addListener(chart, 'select', function(e)
 
like below the hideTimebar(); changes the css
this goes in the googletimeline.js file if it helps anyone
 

 

google.visualization.events.addListener(chart, 'select', function(e) {
				var sel = chart.getSelection();
				//console.log('boom');
				tim=sel;
				//sel.forEach(function(val) {
					
					selections[0]=elemNos[sel[0].row]
					self.selectValues(0, selections, true);
				//});
				//chart.setSelection(tim);
				//selections = selections.concat(sel);
			});
			//chart.setSelection([]);
			
				//new listener
			hideTimebar();
			

 

PriyankaShivhare
Creator II
Creator II

Hi,

is this extension working for u? .it s giving me invalid visualization now earlier it was working fine for me

anwarbham
Contributor III
Contributor III
Author

yes it is make, you might have to reimport it.  incase the widget Id changed, its common in Qlik  

PriyankaShivhare
Creator II
Creator II

i have done that multiple times,,,but not helping,,, still getting the same error.

chouksey17_0-1591893350005.png

chouksey17_0-1591893686533.png

 

FabSpa
Contributor
Contributor

google chart is changed.

read the new spec: https://developers.google.com/chart/interactive/docs/basic_load_libs

Now you need this call:

<script src="https://www.gstatic.com/charts/loader.js"></script>
<script> google.charts.load('current', {packages: ['corechart','table','timechart']});</script>

rather then:

<script src="https://www.google.com/jsapi"></script>
<script>google.charts.load(visualization,1, {packages: ['corechart','table','timechart']});</script>