View LAPP_DisplayChart.app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:application extends="force:slds"> | |
<c:LCMP_DisplayChart /> | |
</aura:application> |
View LCMP_DisplayChart.cmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" access="global" controller="LCC_CaseResults"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /> | |
<aura:attribute name="barData" type="Object[]" /> | |
<aura:attribute name="accountName" type="String" default="" /> | |
<aura:attribute name="divLength" type="String" default="4" /> | |
<aura:attribute name="opencases" type="String" default="Open Cases" /> | |
<aura:attribute name="closedcases" type="String" default="Closed Cases" /> | |
<aura:attribute name="totalcases" type="String" default="Total Cases" /> |
View LCMP_StrikeChart.cmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" access="global" > | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /> | |
<ltng:require scripts="/resource/StrikeCmpResource" afterScriptsLoaded="{!c.onInit}"/> | |
<aura:attribute name="scriptsLoaded" type="Boolean" default="{!false}"/> | |
<aura:attribute name="chartRendered" type="Boolean" default="{!false}" description="Flag to display the loading spinner."/> | |
<aura:attribute name="triggerRedraw" type="Boolean" access="private" default="{!false}" description="Flag that triggers redraw of the chart."/> | |
<aura:attribute name="displayAxis" type="Boolean" access="private" default="{!false}" description="Flag that triggers displaying the left and bottom axis labels."/> |
View LCMP_DisplayChartHelper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
//Generic Method to perform server calls | |
callToServer: function(component, method, callback, params) { | |
component.set("v.showSpinner", true); | |
var action = component.get(method); | |
action.setStorable(); | |
if(params) { | |
action.setParams(params); | |
} | |
action.setCallback(this, function(response) { |
View LCMP_DisplayChartController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
getResponse: function(component, event, helper) { | |
helper.getCases(component); | |
} | |
}) |
View LCMP_DisplayChart.cmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" access="global" controller="LCC_CaseResults"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /> | |
<aura:attribute name="barData" type="Object[]" /> | |
<aura:attribute name="accountName" type="String" default="" /> | |
<aura:attribute name="divLength" type="String" default="4" /> | |
<aura:attribute name="opencases" type="String" default="Open Cases" /> | |
<aura:attribute name="closedcases" type="String" default="Closed cases" /> | |
<aura:attribute name="totalcases" type="String" default="{!$Label.c.CLR417CCCTotalCases}" /> |
View LCMP_StrikeChart.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.THIS .sc-axis-label { | |
color: #bfbebe; | |
} | |
.THIS .sc-axis-value { | |
color: white; | |
font-size: 13px; | |
} | |
.THIS .sc-tooltip { |
View LCMP_StrikeChartRenderer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
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; |
View LCMP_StrikeChartHelper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
//Function which draws the bar chart | |
barChart: function (component, helper) { | |
component.set('v.displayAxis', true); | |
var dataset = component.get("v.data"); //The data retrieved from the controller or parent component | |
var color = helper.getColors(); //Setting the colors to the bars | |
//Setting the orientation of the chart as vertical, can also be turned to horizontal | |
var isVertical = component.get('v.orientation') === 'vertical'; |
View LCMP_StrikeChartController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
//Function called on Init | |
onInit: function (component, event, helper) { | |
var data = component.get("v.data"); | |
component.set('v.scriptsLoaded', true); | |
component.set('v.triggerRedraw', !component.get('v.triggerRedraw')); | |
component.resize = $A.getCallback(function () { | |
if (component.isValid()) { | |
component.set('v.fontSize', helper.determineFontSize(component.get('v.containerWidth'))); | |
component.set('v.chartRendered', false); |
NewerOlder