| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860 |
- /**
- * Dashboard eCommerce
- */
-
- 'use strict';
-
- document.addEventListener('DOMContentLoaded', function (e) {
- let cardColor,
- headingColor,
- labelColor,
- shadeColor,
- borderColor,
- heatMap1,
- heatMap2,
- heatMap3,
- heatMap4,
- fontFamily,
- legendColor;
-
- if (isDarkStyle) {
- shadeColor = 'dark';
- heatMap1 = '#4f51c0';
- heatMap2 = '#595cd9';
- heatMap3 = '#8789ff';
- heatMap4 = '#c3c4ff';
- } else {
- shadeColor = '';
- heatMap1 = '#e1e2ff';
- heatMap2 = '#c3c4ff';
- heatMap3 = '#a5a7ff';
- heatMap4 = '#696cff';
- }
-
- cardColor = config.colors.cardColor;
- headingColor = config.colors.headingColor;
- labelColor = config.colors.textMuted;
- borderColor = config.colors.borderColor;
- fontFamily = config.fontFamily;
- legendColor = config.colors.bodyColor;
-
- // 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: '60%',
- startingShape: 'rounded',
- endingShape: 'rounded',
- borderRadius: 7,
- distributed: true
- }
- },
- grid: {
- show: false,
- padding: {
- top: -25,
- bottom: -12
- }
- },
- 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
- },
- 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%'
- }
- }
- }
- }
- ],
- 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 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();
- }
-
- // 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();
- }
-
- // Total Sales Radial Bar Chart
- // --------------------------------------------------------------------
- const expensesRadialChartEl = document.querySelector('#expensesChart'),
- expensesRadialChartConfig = {
- chart: {
- height: 130,
- sparkline: {
- enabled: true
- },
- parentHeightOffset: 0,
- type: 'radialBar'
- },
- colors: [config.colors.primary],
- series: [78],
- plotOptions: {
- radialBar: {
- startAngle: -90,
- endAngle: 90,
- hollow: {
- size: '55%'
- },
- 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();
- }
-
- // Total Income - Area Chart
- // --------------------------------------------------------------------
- const totalIncomeEl = document.querySelector('#totalIncomeChart'),
- totalIncomeConfig = {
- chart: {
- height: 290,
- type: 'area',
- toolbar: false,
- dropShadow: {
- enabled: true,
- top: 14,
- left: 2,
- blur: 3,
- color: config.colors.primary,
- opacity: 0.15
- }
- },
- series: [
- {
- data: [3350, 3350, 4800, 4800, 2950, 2950, 1800, 1800, 3750, 3750, 5700, 5700]
- }
- ],
- dataLabels: {
- enabled: false
- },
- stroke: {
- width: 3,
- curve: 'straight'
- },
- colors: [config.colors.primary],
- fill: {
- type: 'gradient',
- gradient: {
- shadeIntensity: 1,
- opacityFrom: 0.3,
- gradientToColors: [config.colors.cardColor],
- opacityTo: 0.3,
- stops: [0, 100]
- }
- },
- grid: {
- show: true,
- strokeDashArray: 10,
- borderColor: borderColor,
- padding: {
- top: -15,
- bottom: -10,
- left: 0,
- right: 0
- }
- },
- xaxis: {
- categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- labels: {
- offsetX: 0,
- style: {
- colors: labelColor,
- fontFamily: fontFamily,
- fontSize: '13px'
- }
- },
- axisBorder: {
- show: false
- },
- axisTicks: {
- show: false
- },
- lines: {
- show: false
- }
- },
- yaxis: {
- labels: {
- offsetX: -15,
- formatter: function (val) {
- return '$' + parseInt(val / 1000) + 'k';
- },
- style: {
- fontSize: '13px',
- fontFamily: fontFamily,
- colors: labelColor
- }
- },
- min: 1000,
- max: 6000,
- tickAmount: 5
- }
- };
- if (typeof totalIncomeEl !== undefined && totalIncomeEl !== null) {
- const totalIncome = new ApexCharts(totalIncomeEl, totalIncomeConfig);
- totalIncome.render();
- }
-
- // Performance - Radar Chart
- // --------------------------------------------------------------------
- const performanceChartEl = document.querySelector('#performanceChart'),
- performanceChartConfig = {
- series: [
- {
- name: 'Income',
- data: [26, 29, 31, 40, 29, 24]
- },
- {
- name: 'Earning',
- data: [30, 26, 24, 26, 24, 40]
- }
- ],
- chart: {
- height: 310,
- type: 'radar',
- toolbar: {
- show: false
- },
- dropShadow: {
- enabled: true,
- enabledOnSeries: undefined,
- top: 6,
- left: 0,
- blur: 6,
- color: '#000',
- opacity: 0.14
- }
- },
- plotOptions: {
- radar: {
- polygons: {
- strokeColors: borderColor,
- connectorColors: borderColor
- }
- }
- },
- stroke: {
- show: false,
- width: 0
- },
- legend: {
- show: true,
- fontSize: '13px',
- position: 'bottom',
- labels: {
- colors: legendColor,
- useSeriesColors: false
- },
- markers: {
- size: 5,
- offsetX: -5,
- strokeWidth: 0
- },
- itemMargin: {
- horizontal: 10
- },
- onItemHover: {
- highlightDataSeries: false
- }
- },
- colors: [config.colors.primary, config.colors.info],
- fill: {
- opacity: [1, 0.85]
- },
- markers: {
- size: 0
- },
- grid: {
- show: false,
- padding: {
- top: -8,
- bottom: -5
- }
- },
- xaxis: {
- categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
- labels: {
- show: true,
- style: {
- colors: [labelColor, labelColor, labelColor, labelColor, labelColor, labelColor],
- fontSize: '13px',
- fontFamily: fontFamily
- }
- }
- },
- yaxis: {
- show: false,
- min: 0,
- max: 40,
- tickAmount: 4
- }
- };
- if (typeof performanceChartEl !== undefined && performanceChartEl !== null) {
- const performanceChart = new ApexCharts(performanceChartEl, performanceChartConfig);
- performanceChart.render();
- }
-
- // Conversion rate Line Chart
- // --------------------------------------------------------------------
- const conversionLineChartEl = document.querySelector('#conversionRateChart'),
- conversionLineChartConfig = {
- chart: {
- height: 80,
- width: 140,
- type: 'line',
- toolbar: {
- show: false
- },
- dropShadow: {
- enabled: true,
- top: 10,
- left: 5,
- blur: 3,
- color: config.colors.primary,
- opacity: 0.15
- },
- sparkline: {
- enabled: true
- }
- },
- markers: {
- size: 6,
- colors: 'transparent',
- strokeColors: 'transparent',
- strokeWidth: 4,
- discrete: [
- {
- fillColor: config.colors.white,
- seriesIndex: 0,
- dataPointIndex: 3,
- strokeColor: config.colors.primary,
- strokeWidth: 4,
- size: 6,
- radius: 2
- }
- ],
- offsetX: -1,
- hover: {
- size: 7
- }
- },
- grid: {
- show: false,
- padding: {
- right: 8
- }
- },
- colors: [config.colors.primary],
- dataLabels: {
- enabled: false
- },
- stroke: {
- width: 5,
- curve: 'smooth'
- },
- series: [
- {
- data: [137, 210, 160, 245]
- }
- ],
- xaxis: {
- show: false,
- lines: {
- show: false
- },
- labels: {
- show: false
- },
- axisBorder: {
- show: false
- }
- },
- yaxis: {
- show: false
- }
- };
- if (typeof conversionLineChartEl !== undefined && conversionLineChartEl !== null) {
- const conversionLineChart = new ApexCharts(conversionLineChartEl, conversionLineChartConfig);
- conversionLineChart.render();
- }
-
- // Conversion rate Line Chart
- // --------------------------------------------------------------------
- const expensesBarChartEl = document.querySelector('#expensesBarChart'),
- expensesBarChartConfig = {
- chart: {
- height: 190,
- stacked: true,
- type: 'bar',
- toolbar: { show: false }
- },
- series: [
- {
- name: '2021',
- data: [15, 37, 14, 30, 38, 30, 20, 13, 14, 23]
- },
- {
- name: '2020',
- data: [-33, -23, -29, -21, -25, -21, -23, -19, -37, -22]
- }
- ],
- plotOptions: {
- bar: {
- horizontal: false,
- columnWidth: '40%',
- borderRadius: 5,
- startingShape: 'rounded',
- endingShape: 'rounded',
- borderRadiusApplication: 'around'
- }
- },
- colors: [config.colors.primary, config.colors.warning],
- dataLabels: {
- enabled: false
- },
- stroke: {
- curve: 'smooth',
- width: 2,
- lineCap: 'round',
- colors: [cardColor]
- },
- legend: {
- show: false
- },
- grid: {
- show: false,
- padding: {
- top: -10
- }
- },
- fill: {
- opacity: [1, 1]
- },
- xaxis: {
- show: false,
- categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
- labels: {
- show: false
- },
- axisTicks: {
- show: false
- },
- axisBorder: {
- show: false
- }
- },
- yaxis: {
- show: false
- },
- states: {
- hover: {
- filter: {
- type: 'none'
- }
- },
- active: {
- filter: {
- type: 'none'
- }
- }
- }
- };
- if (typeof expensesBarChartEl !== undefined && expensesBarChartEl !== null) {
- const expensesBarChart = new ApexCharts(expensesBarChartEl, expensesBarChartConfig);
- expensesBarChart.render();
- }
-
- // Total Balance - Line Chart
- // --------------------------------------------------------------------
- const totalBalanceChartEl = document.querySelector('#totalBalanceChart'),
- totalBalanceChartConfig = {
- series: [
- {
- data: [137, 210, 160, 275, 205, 315]
- }
- ],
- chart: {
- height: 245,
- parentHeightOffset: 0,
- parentWidthOffset: 0,
- type: 'line',
- dropShadow: {
- enabled: true,
- top: 10,
- left: 5,
- blur: 3,
- color: config.colors.warning,
- opacity: 0.25
- },
- toolbar: {
- show: false
- }
- },
- dataLabels: {
- enabled: false
- },
- stroke: {
- width: 4,
- curve: 'smooth'
- },
- legend: {
- show: false
- },
- colors: [config.colors.warning],
- markers: {
- size: 6,
- colors: 'transparent',
- strokeColors: 'transparent',
- strokeWidth: 4,
- discrete: [
- {
- fillColor: config.colors.white,
- seriesIndex: 0,
- dataPointIndex: 5,
- strokeColor: config.colors.warning,
- strokeWidth: 8,
- size: 8,
- radius: 8
- }
- ],
- offsetX: -1,
- hover: {
- size: 9
- }
- },
- grid: {
- show: false,
- padding: {
- top: -10,
- left: 0,
- right: 0,
- bottom: 10
- }
- },
- xaxis: {
- categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
- axisBorder: {
- show: false
- },
- axisTicks: {
- show: false
- },
- labels: {
- show: true,
- style: {
- fontSize: '13px',
- fontFamily: fontFamily,
- colors: labelColor
- }
- }
- },
- yaxis: {
- labels: {
- show: false
- }
- }
- };
- if (typeof totalBalanceChartEl !== undefined && totalBalanceChartEl !== null) {
- const totalBalanceChart = new ApexCharts(totalBalanceChartEl, totalBalanceChartConfig);
- totalBalanceChart.render();
- }
- });
|