1var aController = true; 2var ChartLeftIndent = 50; 3var ChartWidth = "85%"; 4function checkWindowWidth(){ 5 if($(window).width() <= (BREAK.MN)){ 6 ChartLeftIndent = 30; 7 ChartWidth = "85%"; 8 }else if($(window).width() <= (BREAK.VS)){ 9 ChartLeftIndent = 35; 10 ChartWidth = "85%"; 11 }else{ 12 ChartLeftIndent = 50; 13 ChartWidth = "85%"; 14 } 15}checkWindowWidth(); 16function drawChart() { 17 var data = google.visualization.arrayToDataTable([ 18 ['Year', 'Sales'], 19 [1, 20], 20 [2, 30], 21 [3, 24], 22 [4, 40], 23 [5, 28], 24 [6, 34], 25 [7, 29], 26 [8, 20], 27 [9, 30], 28 [10, 25], 29 [11, 40], 30 [12, 27] 31 ]); 32 33 34 35 var options = { 36 titleTextStyle: {color: '#fff', fontName: "<global-font-name>", fontSize: "16"}, 37 axisTitlesPosition: 'out', 38 backgroundColor: {fill: "#ef743d" }, 39 chartArea:{left:ChartLeftIndent,top:20,width:ChartWidth,height:'83%'}, 40 hAxis:{ 41 textStyle: { 42 color: '#fff', 43 fontName: "<global-font-name>" 44 }, 45 baselineColor: "#f5a581", 46 gridlines: { 47 color: '#f5a581', 48 count: '12' 49 } 50 }, 51 vAxis:{ 52 textStyle: { 53 color: '#fff', 54 fontName: "<global-font-name>" 55 }, 56 maxValue: "50", 57 baselineColor: "#f5a581", 58 gridlines: { 59 color: '#f5a581' 60 } 61 }, 62 legend: "none", 63 pointSize: 7, 64 series: { 65 0: { color: '#fff', pointShape: 'circle' } 66 } 67 } 68 69 var chart = new google.visualization.LineChart(document.getElementById('chart_div')); 70 chart.draw(data, options); 71 $( window ).on('resize', function(){ 72 if (aController){ 73 resizeController(); 74 } 75 }); 76} 77if($('.b-chart').size() > 0){ 78 google.load("visualization", "1.1", {packages:["corechart"]}); 79 80 google.setOnLoadCallback(drawChart()); 81 82} 83var timeout; 84var controllerCounter = 0; 85function resizeController(){ 86 if(controllerCounter < 1){ 87 aController = false; 88 clearTimeout(timeout); 89 timeout = setTimeout(function(){ 90 if (aController){ 91 controllerCounter++; 92 }else{ 93 controllerCounter = 0; 94 } 95 resizeController(); 96 aController = true; 97 }, 100); 98 }else{ 99 aController = true; 100 controllerCounter = 0; 101 checkWindowWidth(); 102 drawChart(); 103 } 104}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.