Skip to content

Instantly share code, notes, and snippets.

@induprasad
Created May 3, 2018 13:03
Show Gist options
  • Save induprasad/64ac5f1c8531129cb2323d58ab390612 to your computer and use it in GitHub Desktop.
Save induprasad/64ac5f1c8531129cb2323d58ab390612 to your computer and use it in GitHub Desktop.
Renderer of the LCMP_StrikeChart component
({
rerender: function (component, helper) {
this.superRerender();
if (!component.get('v.scriptsLoaded') || component.get('v.chartRendered')) {
return;
}
//make sure threshold isn't a string
component.get('v.thresholdValue', parseInt(component.get('v.thresholdValue')));
var containerWidth = component.find('chartContainer').getElement().clientWidth;
component.set('v.containerWidth', containerWidth);
var chartDiv = component.find('chart').getElement();
chartDiv.innerHTML = '';
helper.drawChart(component, helper);
},
unrender: function(component) {
this.superUnrender();
window.removeEventListener('resize', component.resize);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment