LaravelTest
270 строк · 6.2 Кб
1/* global Chart:false */
2
3$(function () {4'use strict'5
6/* ChartJS7* -------
8* Here we will create a few charts using ChartJS
9*/
10
11//-----------------------12// - MONTHLY SALES CHART -13//-----------------------14
15// Get context with jQuery - using jQuery's .get() method.16var salesChartCanvas = $('#salesChart').get(0).getContext('2d')17
18var salesChartData = {19labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],20datasets: [21{22label: 'Digital Goods',23backgroundColor: 'rgba(60,141,188,0.9)',24borderColor: 'rgba(60,141,188,0.8)',25pointRadius: false,26pointColor: '#3b8bba',27pointStrokeColor: 'rgba(60,141,188,1)',28pointHighlightFill: '#fff',29pointHighlightStroke: 'rgba(60,141,188,1)',30data: [28, 48, 40, 19, 86, 27, 90]31},32{33label: 'Electronics',34backgroundColor: 'rgba(210, 214, 222, 1)',35borderColor: 'rgba(210, 214, 222, 1)',36pointRadius: false,37pointColor: 'rgba(210, 214, 222, 1)',38pointStrokeColor: '#c1c7d1',39pointHighlightFill: '#fff',40pointHighlightStroke: 'rgba(220,220,220,1)',41data: [65, 59, 80, 81, 56, 55, 40]42}43]44}45
46var salesChartOptions = {47maintainAspectRatio: false,48responsive: true,49legend: {50display: false51},52scales: {53xAxes: [{54gridLines: {55display: false56}57}],58yAxes: [{59gridLines: {60display: false61}62}]63}64}65
66// This will get the first returned node in the jQuery collection.67// eslint-disable-next-line no-unused-vars68var salesChart = new Chart(salesChartCanvas, {69type: 'line',70data: salesChartData,71options: salesChartOptions72}73)74
75//---------------------------76// - END MONTHLY SALES CHART -77//---------------------------78
79//-------------80// - PIE CHART -81//-------------82// Get context with jQuery - using jQuery's .get() method.83var pieChartCanvas = $('#pieChart').get(0).getContext('2d')84var pieData = {85labels: [86'Chrome',87'IE',88'FireFox',89'Safari',90'Opera',91'Navigator'92],93datasets: [94{95data: [700, 500, 400, 600, 300, 100],96backgroundColor: ['#f56954', '#00a65a', '#f39c12', '#00c0ef', '#3c8dbc', '#d2d6de']97}98]99}100var pieOptions = {101legend: {102display: false103}104}105// Create pie or douhnut chart106// You can switch between pie and douhnut using the method below.107// eslint-disable-next-line no-unused-vars108var pieChart = new Chart(pieChartCanvas, {109type: 'doughnut',110data: pieData,111options: pieOptions112})113
114//-----------------115// - END PIE CHART -116//-----------------117
118/* jVector Maps119* ------------
120* Create a world map with markers
121*/
122$('#world-map-markers').mapael({123map: {124name: 'usa_states',125zoom: {126enabled: true,127maxLevel: 10128}129}130})131
132// $('#world-map-markers').vectorMap({133// map : 'world_en',134// normalizeFunction: 'polynomial',135// hoverOpacity : 0.7,136// hoverColor : false,137// backgroundColor : 'transparent',138// regionStyle : {139// initial : {140// fill : 'rgba(210, 214, 222, 1)',141// 'fill-opacity' : 1,142// stroke : 'none',143// 'stroke-width' : 0,144// 'stroke-opacity': 1145// },146// hover : {147// 'fill-opacity': 0.7,148// cursor : 'pointer'149// },150// selected : {151// fill: 'yellow'152// },153// selectedHover: {}154// },155// markerStyle : {156// initial: {157// fill : '#00a65a',158// stroke: '#111'159// }160// },161// markers : [162// {163// latLng: [41.90, 12.45],164// name : 'Vatican City'165// },166// {167// latLng: [43.73, 7.41],168// name : 'Monaco'169// },170// {171// latLng: [-0.52, 166.93],172// name : 'Nauru'173// },174// {175// latLng: [-8.51, 179.21],176// name : 'Tuvalu'177// },178// {179// latLng: [43.93, 12.46],180// name : 'San Marino'181// },182// {183// latLng: [47.14, 9.52],184// name : 'Liechtenstein'185// },186// {187// latLng: [7.11, 171.06],188// name : 'Marshall Islands'189// },190// {191// latLng: [17.3, -62.73],192// name : 'Saint Kitts and Nevis'193// },194// {195// latLng: [3.2, 73.22],196// name : 'Maldives'197// },198// {199// latLng: [35.88, 14.5],200// name : 'Malta'201// },202// {203// latLng: [12.05, -61.75],204// name : 'Grenada'205// },206// {207// latLng: [13.16, -61.23],208// name : 'Saint Vincent and the Grenadines'209// },210// {211// latLng: [13.16, -59.55],212// name : 'Barbados'213// },214// {215// latLng: [17.11, -61.85],216// name : 'Antigua and Barbuda'217// },218// {219// latLng: [-4.61, 55.45],220// name : 'Seychelles'221// },222// {223// latLng: [7.35, 134.46],224// name : 'Palau'225// },226// {227// latLng: [42.5, 1.51],228// name : 'Andorra'229// },230// {231// latLng: [14.01, -60.98],232// name : 'Saint Lucia'233// },234// {235// latLng: [6.91, 158.18],236// name : 'Federated States of Micronesia'237// },238// {239// latLng: [1.3, 103.8],240// name : 'Singapore'241// },242// {243// latLng: [1.46, 173.03],244// name : 'Kiribati'245// },246// {247// latLng: [-21.13, -175.2],248// name : 'Tonga'249// },250// {251// latLng: [15.3, -61.38],252// name : 'Dominica'253// },254// {255// latLng: [-20.2, 57.5],256// name : 'Mauritius'257// },258// {259// latLng: [26.02, 50.55],260// name : 'Bahrain'261// },262// {263// latLng: [0.33, 6.73],264// name : 'São Tomé and Príncipe'265// }266// ]267// })268})269
270// lgtm [js/unused-local-variable]
271