update dashboard
This commit is contained in:
@@ -15,7 +15,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
ButtonModule,
|
ButtonModule,
|
||||||
RippleModule,
|
RippleModule,
|
||||||
],
|
],
|
||||||
template: `<div class="card">
|
template: `<div class="card !mb-8">
|
||||||
<div class="font-semibold text-xl mb-4">Recent Sales</div>
|
<div class="font-semibold text-xl mb-4">Recent Sales</div>
|
||||||
<p-table [value]="products" [paginator]="true" [rows]="5" responsiveLayout="scroll">
|
<p-table [value]="products" [paginator]="true" [rows]="5" responsiveLayout="scroll">
|
||||||
<ng-template pTemplate="header">
|
<ng-template pTemplate="header">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { LayoutService } from '@/src/service/layout.service';
|
|||||||
imports: [
|
imports: [
|
||||||
ChartModule,
|
ChartModule,
|
||||||
],
|
],
|
||||||
template: `<div class="card">
|
template: `<div class="card !mb-8">
|
||||||
<div class="font-semibold text-xl mb-4">Revenue Stream</div>
|
<div class="font-semibold text-xl mb-4">Revenue Stream</div>
|
||||||
<p-chart type="bar" [data]="chartData" [options]="chartOptions" class="h-80" />
|
<p-chart type="bar" [data]="chartData" [options]="chartOptions" class="h-80" />
|
||||||
</div>`,
|
</div>`,
|
||||||
@@ -35,57 +35,64 @@ export class RevenueStreamWidget {
|
|||||||
|
|
||||||
initChart() {
|
initChart() {
|
||||||
const documentStyle = getComputedStyle(document.documentElement);
|
const documentStyle = getComputedStyle(document.documentElement);
|
||||||
const textColor = documentStyle.getPropertyValue('--text-color');
|
const borderColor = documentStyle.getPropertyValue('--surface-border');
|
||||||
const textColorSecondary = documentStyle.getPropertyValue('--text-color-secondary');
|
const textMutedColor = documentStyle.getPropertyValue('--text-color-secondary');
|
||||||
const surfaceBorder = documentStyle.getPropertyValue('--surface-border');
|
|
||||||
|
|
||||||
this.chartData = {
|
this.chartData = {
|
||||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: 'First Dataset',
|
type: 'bar',
|
||||||
data: [65, 59, 80, 81, 56, 55, 40],
|
label: 'Subscriptions',
|
||||||
fill: false,
|
backgroundColor: documentStyle.getPropertyValue('--p-primary-400'),
|
||||||
backgroundColor: documentStyle.getPropertyValue('--bluegray-700'),
|
data: [4000, 10000, 15000, 4000],
|
||||||
borderColor: documentStyle.getPropertyValue('--bluegray-700'),
|
barThickness: 32
|
||||||
tension: .4
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Second Dataset',
|
type: 'bar',
|
||||||
data: [28, 48, 40, 19, 86, 27, 90],
|
label: 'Advertising',
|
||||||
fill: false,
|
backgroundColor: documentStyle.getPropertyValue('--p-primary-300'),
|
||||||
backgroundColor: documentStyle.getPropertyValue('--green-600'),
|
data: [2100, 8400, 2400, 7500],
|
||||||
borderColor: documentStyle.getPropertyValue('--green-600'),
|
barThickness: 32
|
||||||
tension: .4
|
},
|
||||||
|
{
|
||||||
|
type: 'bar',
|
||||||
|
label: 'Affiliate',
|
||||||
|
backgroundColor: documentStyle.getPropertyValue('--p-primary-200'),
|
||||||
|
data: [4100, 5200, 3400, 7400],
|
||||||
|
borderRadius: {
|
||||||
|
topLeft: 8,
|
||||||
|
topRight: 8
|
||||||
|
},
|
||||||
|
borderSkipped: true,
|
||||||
|
barThickness: 32
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.chartOptions = {
|
this.chartOptions = {
|
||||||
plugins: {
|
maintainAspectRatio: false,
|
||||||
legend: {
|
aspectRatio: 0.8,
|
||||||
labels: {
|
|
||||||
color: textColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
|
stacked: true,
|
||||||
ticks: {
|
ticks: {
|
||||||
color: textColorSecondary
|
color: textMutedColor
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
color: surfaceBorder,
|
color: 'transparent',
|
||||||
drawBorder: false
|
borderColor: 'transparent'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
|
stacked: true,
|
||||||
ticks: {
|
ticks: {
|
||||||
color: textColorSecondary
|
color: textMutedColor
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
color: surfaceBorder,
|
color: borderColor,
|
||||||
drawBorder: false
|
borderColor: 'transparent',
|
||||||
|
drawTicks: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { NotificationsWidget } from '@/src/components/dashboard/notificationswid
|
|||||||
imports: [StatsWidget, RecentSalesWidget, BestSellingWidget, RevenueStreamWidget, NotificationsWidget],
|
imports: [StatsWidget, RecentSalesWidget, BestSellingWidget, RevenueStreamWidget, NotificationsWidget],
|
||||||
template: `
|
template: `
|
||||||
<div class="grid grid-cols-12 gap-8">
|
<div class="grid grid-cols-12 gap-8">
|
||||||
<app-stats-widget />
|
<app-stats-widget class="contents" />
|
||||||
<div class="col-span-12 xl:col-span-6">
|
<div class="col-span-12 xl:col-span-6">
|
||||||
<app-recent-sales-widget />
|
<app-recent-sales-widget />
|
||||||
<app-best-selling-widget />
|
<app-best-selling-widget />
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ import {TextareaModule} from "primeng/textarea";
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex mt-20">
|
<div class="flex mt-8">
|
||||||
<div class="card flex flex-col gap-6 w-full">
|
<div class="card flex flex-col gap-6 w-full">
|
||||||
<div class="font-semibold text-xl">Advanced</div>
|
<div class="font-semibold text-xl">Advanced</div>
|
||||||
<div class="flex flex-col md:flex-row gap-6">
|
<div class="flex flex-col md:flex-row gap-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user