| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757 |
- /**
- * Statistics Cards
- */
-
- 'use strict';
-
- document.addEventListener('DOMContentLoaded', function (e) {
- let cardColor, shadeColor, labelColor, headingColor, fontFamily, legendColor;
-
- if (isDarkStyle) {
- shadeColor = 'dark';
- } else {
- shadeColor = 'light';
- }
- cardColor = config.colors.cardColor;
- labelColor = config.colors.textMuted;
- legendColor = config.colors.bodyColor;
- headingColor = config.colors.headingColor;
- fontFamily = config.fontFamily;
-
- // Donut Chart Colors
- const chartColors = {
- donut: {
- series1: '#66C732',
- series2: '#8DE45F',
- series3: '#AAEB87',
- series4: '#E3F8D7'
- }
- };
-
- // Order Area Chart
- // --------------------------------------------------------------------
- const orderAreaChartEl = document.querySelector('#orderChart'),
- orderAreaChartConfig = {
- chart: {
- height: 104,
- type: 'area',
- toolbar: {
- show: false
- },
- sparkline: {
- enabled: true
- }
- },
- markers: {
- size: 6,
- colors: 'transparent',
- strokeColors: 'transparent',
- strokeWidth: 4,
- discrete: [
- {
- fillColor: cardColor,
- seriesIndex: 0,
- dataPointIndex: 6,
- strokeColor: config.colors.success,
- strokeWidth: 2,
- size: 5,
- radius: 8
- }
- ],
- hover: {
- size: 7
- }
- },
- grid: {
- show: false,
- padding: {
- top: 15,
- right: 7,
- left: 0
- }
- },
- colors: [config.colors.success],
- fill: {
- type: 'gradient',
- gradient: {
- shadeIntensity: 1,
- opacityFrom: 0.4,
- gradientToColors: [config.colors.cardColor],
- opacityTo: 0.4,
- stops: [0, 100]
- }
- },
- dataLabels: {
- enabled: false
- },
- stroke: {
- width: 2,
- curve: 'smooth'
- },
- series: [
- {
- data: [180, 175, 275, 140, 205, 190, 295]
- }
- ],
- xaxis: {
- show: false,
- lines: {
- show: false
- },
- labels: {
- show: false
- },
- stroke: {
- width: 0
- },
- axisBorder: {
- show: false
- }
- },
- yaxis: {
- stroke: {
- width: 0
- },
- show: false
- }
- };
- if (typeof orderAreaChartEl !== undefined && orderAreaChartEl !== null) {
- const orderAreaChart = new ApexCharts(orderAreaChartEl, orderAreaChartConfig);
- orderAreaChart.render();
- }
-
- // Revenue Bar Chart
- // --------------------------------------------------------------------
- const revenueBarChartEl = document.querySelector('#revenueChart'),
- revenueBarChartConfig = {
- chart: {
- height: 95,
- type: 'bar',
- toolbar: {
- show: false
- }
- },
- plotOptions: {
- bar: {
- barHeight: '80%',
- columnWidth: '54%',
- startingShape: 'rounded',
- endingShape: 'rounded',
- borderRadius: 2,
- distributed: true
- }
- },
- grid: {
- show: false,
- padding: {
- top: -20,
- bottom: -12,
- left: -10,
- right: 0
- }
- },
- colors: [
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors.primary,
- config.colors_label.primary,
- config.colors_label.primary
- ],
- dataLabels: {
- enabled: false
- },
- series: [
- {
- data: [40, 95, 60, 45, 90, 50, 75]
- }
- ],
- states: {
- hover: {
- filter: {
- type: 'none'
- }
- },
- active: {
- filter: {
- type: 'none'
- }
- }
- },
- legend: {
- show: false
- },
- xaxis: {
- categories: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
- axisBorder: {
- show: false
- },
- axisTicks: {
- show: false
- },
- labels: {
- style: {
- colors: labelColor,
- fontSize: '13px'
- }
- }
- },
- yaxis: {
- labels: {
- show: false
- }
- }
- };
- if (typeof revenueBarChartEl !== undefined && revenueBarChartEl !== null) {
- const revenueBarChart = new ApexCharts(revenueBarChartEl, revenueBarChartConfig);
- revenueBarChart.render();
- }
-
- // Profit Bar Chart
- // --------------------------------------------------------------------
- const profitBarChartEl = document.querySelector('#profitChart'),
- profitBarChartConfig = {
- series: [
- {
- data: [73, 56, 56, 100]
- },
- {
- data: [61, 42, 74, 72]
- }
- ],
- chart: {
- type: 'bar',
- height: 90,
- toolbar: {
- tools: {
- download: false
- }
- }
- },
- plotOptions: {
- bar: {
- columnWidth: '69%',
- startingShape: 'rounded',
- endingShape: 'rounded',
- borderRadius: 3,
- dataLabels: {
- show: false
- }
- }
- },
- states: {
- hover: {
- filter: {
- type: 'none'
- }
- },
- active: {
- filter: {
- type: 'none'
- }
- }
- },
- grid: {
- show: false,
- padding: {
- top: -30,
- bottom: -12,
- left: -10,
- right: 0
- }
- },
- colors: [config.colors.success, config.colors_label.success],
- dataLabels: {
- enabled: false
- },
- stroke: {
- show: true,
- width: 5,
- colors: cardColor
- },
- legend: {
- show: false
- },
- xaxis: {
- categories: ['Jan', 'Apr', 'Jul', 'Oct'],
- axisBorder: {
- show: false
- },
- axisTicks: {
- show: false
- },
- labels: {
- style: {
- colors: labelColor,
- fontSize: '13px'
- }
- }
- },
- yaxis: {
- labels: {
- show: false
- }
- }
- };
- if (typeof profitBarChartEl !== undefined && profitBarChartEl !== null) {
- const profitBarChart = new ApexCharts(profitBarChartEl, profitBarChartConfig);
- profitBarChart.render();
- }
-
- // Session Area Chart
- // --------------------------------------------------------------------
- const sessionAreaChartEl = document.querySelector('#sessionsChart'),
- sessionAreaChartConfig = {
- chart: {
- height: 104,
- type: 'area',
- toolbar: {
- show: false
- },
- sparkline: {
- enabled: true
- }
- },
- markers: {
- size: 6,
- colors: 'transparent',
- strokeColors: 'transparent',
- strokeWidth: 4,
- discrete: [
- {
- fillColor: cardColor,
- seriesIndex: 0,
- dataPointIndex: 8,
- strokeColor: config.colors.warning,
- strokeWidth: 2,
- size: 5,
- radius: 8
- }
- ],
- hover: {
- size: 7
- }
- },
- grid: {
- show: false,
- padding: {
- right: 8
- }
- },
- colors: [config.colors.warning],
- fill: {
- type: 'gradient',
- gradient: {
- shadeIntensity: 1,
- opacityFrom: 0.4,
- gradientToColors: [config.colors.cardColor],
- opacityTo: 0.4,
- stops: [0, 85, 100]
- }
- },
- dataLabels: {
- enabled: false
- },
- stroke: {
- width: 2,
- curve: 'straight'
- },
- series: [
- {
- data: [340, 340, 300, 300, 240, 240, 320, 320, 370]
- }
- ],
- xaxis: {
- show: false,
- lines: {
- show: false
- },
- labels: {
- show: false
- },
- axisBorder: {
- show: false
- }
- },
- yaxis: {
- show: false
- }
- };
- if (typeof sessionAreaChartEl !== undefined && sessionAreaChartEl !== null) {
- const sessionAreaChart = new ApexCharts(sessionAreaChartEl, sessionAreaChartConfig);
- sessionAreaChart.render();
- }
- // Total Sales Radial Bar Chart
- // --------------------------------------------------------------------
- const expensesRadialChartEl = document.querySelector('#expensesChart'),
- expensesRadialChartConfig = {
- chart: {
- sparkline: {
- enabled: true
- },
- parentHeightOffset: 0,
- type: 'radialBar'
- },
- colors: [config.colors.primary],
- series: [78],
- plotOptions: {
- radialBar: {
- startAngle: -90,
- endAngle: 90,
- hollow: {
- size: '65%'
- },
- track: {
- background: config.colors_label.secondary
- },
- dataLabels: {
- name: {
- show: false
- },
- value: {
- fontSize: '18px',
- fontFamily: fontFamily,
- color: headingColor,
- fontWeight: 500,
- offsetY: -5
- }
- }
- }
- },
- grid: {
- show: false,
- padding: {
- left: -10,
- right: -10,
- bottom: 5
- }
- },
- stroke: {
- lineCap: 'round'
- },
- labels: ['Progress']
- };
- if (typeof expensesRadialChartEl !== undefined && expensesRadialChartEl !== null) {
- const expensesRadialChart = new ApexCharts(expensesRadialChartEl, expensesRadialChartConfig);
- expensesRadialChart.render();
- }
-
- // Visitor Bar Chart
- // --------------------------------------------------------------------
- const visitorBarChartEl = document.querySelector('#visitorsChart'),
- visitorBarChartConfig = {
- chart: {
- height: 120,
- width: 200,
- parentHeightOffset: 0,
- type: 'bar',
- toolbar: {
- show: false
- }
- },
- plotOptions: {
- bar: {
- barHeight: '75%',
- columnWidth: '54%',
- startingShape: 'rounded',
- endingShape: 'rounded',
- borderRadius: 5,
- distributed: true
- }
- },
- grid: {
- show: false,
- padding: {
- top: -25,
- bottom: -12
- }
- },
- states: {
- hover: {
- filter: {
- type: 'none'
- }
- },
- active: {
- filter: {
- type: 'none'
- }
- }
- },
- colors: [
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors_label.primary,
- config.colors.primary,
- config.colors_label.primary
- ],
- dataLabels: {
- enabled: false
- },
- series: [
- {
- data: [40, 95, 60, 45, 90, 50, 75]
- }
- ],
- legend: {
- show: false
- },
- xaxis: {
- categories: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
- axisBorder: {
- show: false
- },
- axisTicks: {
- show: false
- },
- labels: {
- style: {
- colors: labelColor,
- fontSize: '13px'
- }
- }
- },
- yaxis: {
- labels: {
- show: false
- }
- },
- responsive: [
- {
- breakpoint: 1440,
- options: {
- plotOptions: {
- bar: {
- borderRadius: 9,
- columnWidth: '60%'
- }
- }
- }
- },
- {
- breakpoint: 1300,
- options: {
- plotOptions: {
- bar: {
- borderRadius: 9,
- columnWidth: '60%'
- }
- }
- }
- },
- {
- breakpoint: 1200,
- options: {
- plotOptions: {
- bar: {
- borderRadius: 8,
- columnWidth: '50%'
- }
- }
- }
- },
- {
- breakpoint: 1040,
- options: {
- plotOptions: {
- bar: {
- borderRadius: 8,
- columnWidth: '50%'
- }
- }
- }
- },
- {
- breakpoint: 991,
- options: {
- plotOptions: {
- bar: {
- borderRadius: 8,
- columnWidth: '50%'
- }
- }
- }
- },
- {
- breakpoint: 420,
- options: {
- plotOptions: {
- bar: {
- borderRadius: 8,
- columnWidth: '50%'
- }
- }
- }
- }
- ]
- };
- if (typeof visitorBarChartEl !== undefined && visitorBarChartEl !== null) {
- const visitorBarChart = new ApexCharts(visitorBarChartEl, visitorBarChartConfig);
- visitorBarChart.render();
- }
-
- // Activity Area Chart
- // --------------------------------------------------------------------
- const activityAreaChartEl = document.querySelector('#activityChart'),
- activityAreaChartConfig = {
- chart: {
- height: 110,
- width: 220,
- parentHeightOffset: 0,
- toolbar: {
- show: false
- },
- type: 'area'
- },
- dataLabels: {
- enabled: false
- },
- stroke: {
- width: 2,
- curve: 'smooth'
- },
- series: [
- {
- data: [15, 22, 17, 39, 12, 35, 25]
- }
- ],
- colors: [config.colors.success],
- fill: {
- type: 'gradient',
- gradient: {
- shadeIntensity: 1,
- opacityFrom: 0.7,
- gradientToColors: [config.colors.cardColor],
- opacityTo: 0.2,
- stops: [0, 85, 100]
- }
- },
- grid: {
- show: false,
- padding: {
- top: -20,
- bottom: -8
- }
- },
- legend: {
- show: false
- },
- xaxis: {
- categories: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
- axisBorder: {
- show: false
- },
- axisTicks: {
- show: false
- },
- labels: {
- style: {
- fontSize: '13px',
- colors: labelColor
- }
- }
- },
- yaxis: {
- labels: {
- show: false
- }
- }
- };
- if (typeof activityAreaChartEl !== undefined && activityAreaChartEl !== null) {
- const activityAreaChart = new ApexCharts(activityAreaChartEl, activityAreaChartConfig);
- activityAreaChart.render();
- }
-
- // Order Statistics Chart
- // --------------------------------------------------------------------
- const leadsReportChartEl = document.querySelector('#leadsReportChart'),
- leadsReportChartConfig = {
- chart: {
- height: 157,
- width: 130,
- parentHeightOffset: 0,
- type: 'donut'
- },
- labels: ['Electronic', 'Sports', 'Decor', 'Fashion'],
- series: [20, 30, 20, 30],
- colors: [
- chartColors.donut.series1,
- chartColors.donut.series4,
- chartColors.donut.series3,
- chartColors.donut.series2
- ],
- stroke: {
- width: 0
- },
- dataLabels: {
- enabled: false,
- formatter: function (val, opt) {
- return parseInt(val) + '%';
- }
- },
- legend: {
- show: false
- },
- tooltip: {
- theme: false
- },
- grid: {
- padding: {
- top: 15
- }
- },
- states: {
- hover: {
- filter: {
- type: 'none'
- }
- },
- active: {
- filter: {
- type: 'none'
- }
- }
- },
- plotOptions: {
- pie: {
- donut: {
- size: '75%',
- labels: {
- show: true,
- value: {
- fontSize: '1.5rem',
- fontFamily: fontFamily,
- color: headingColor,
- fontWeight: 500,
- offsetY: -15,
- formatter: function (val) {
- return parseInt(val) + '%';
- }
- },
- name: {
- offsetY: 20,
- fontFamily: fontFamily
- },
- total: {
- show: true,
- fontSize: '15px',
- fontFamily: fontFamily,
- label: 'Average',
- color: legendColor,
- formatter: function (w) {
- return '25%';
- }
- }
- }
- }
- }
- }
- };
- if (typeof leadsReportChartEl !== undefined && leadsReportChartEl !== null) {
- const leadsReportChart = new ApexCharts(leadsReportChartEl, leadsReportChartConfig);
- leadsReportChart.render();
- }
- });
|