Skip to content

Commit bcd0b89

Browse files
committed
Fix dashboard charts
1 parent 633fcac commit bcd0b89

File tree

6 files changed

+45
-49
lines changed

6 files changed

+45
-49
lines changed

src-ts/Dashboard/KeyMetrics/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export const generateTrendChartData = ({
1313
data: {
1414
datasets: [
1515
{
16-
backgroundColor: theme.palette.secondary.main,
17-
borderColor: theme.palette.secondary.main,
16+
backgroundColor: theme.palette.primary.main,
17+
borderColor: theme.palette.primary.main,
1818
borderWidth: 2,
1919
pointRadius: 1,
2020
pointHoverRadius: 3,

src-ts/Dashboard/SubscriptionsBreakdown/SubscriptionsBreakdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const useStyles = makeStyles((theme) => ({
5858
textAlign: 'right',
5959
},
6060
headerIcon: {
61-
color: theme.palette.secondary.main,
61+
color: theme.palette.grey[300],
6262
verticalAlign: 'sub',
6363
marginRight: '.3em',
6464
},

src-ts/Dashboard/SubscriptionsBreakdown/data.ts

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const chart = {
1010
label: 'Customers',
1111
fill: false,
1212
data: [1545, 540, 749, 310, 56],
13-
yAxisID: 'y1',
13+
yAxisID: 'y',
1414
},
1515
{
1616
backgroundColor: 'rgba(136, 151, 170, 0.1)',
@@ -19,32 +19,26 @@ export const chart = {
1919
borderWidth: 1,
2020
data: [23686, 30820, 59622, 146465, 78160],
2121
label: 'Total Monthly Revenue, $',
22-
yAxisID: 'y2',
22+
yAxisID: 'y1',
2323
},
2424
],
2525
labels: ['Trial', 'Starter', 'Pro', 'Silver', 'Gold'],
2626
},
2727
options: {
2828
scales: {
29-
xAxes: [
30-
{
31-
gridLines: { display: false },
32-
ticks: { fontColor: '#aaa', autoSkipPadding: 50 },
33-
},
34-
],
35-
yAxes: [
36-
{
37-
id: 'y1',
38-
gridLines: { display: false },
39-
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
40-
},
41-
{
42-
position: 'right',
43-
id: 'y2',
44-
gridLines: { display: false },
45-
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
46-
},
47-
],
29+
x: {
30+
grid: { display: false },
31+
ticks: { fontColor: '#aaa', autoSkipPadding: 50 },
32+
},
33+
y: {
34+
grid: { display: false },
35+
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
36+
},
37+
y1: {
38+
position: 'right',
39+
grid: { display: false },
40+
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
41+
},
4842
},
4943
tooltips: {
5044
mode: 'index',

src-ts/Dashboard/SubscriptionsHistory/SubscriptionsHistory.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import { subscriptionsItems, subscriptionsHistoryChart } from './data'
1717
const Subscriptions = () => {
1818
const classes = useStyles()
1919

20+
console.log('subscriptionsHistoryChart', subscriptionsHistoryChart)
21+
2022
return (
2123
<Card>
2224
<CardHeader
@@ -68,7 +70,7 @@ const Subscriptions = () => {
6870
</Typography>
6971
</Grid>
7072
</Grid>
71-
<LinearProgress variant="determinate" value={ratio} color="secondary" />
73+
<LinearProgress variant="determinate" value={ratio} color="primary" />
7274
</div>
7375
))}
7476
</Grid>
@@ -93,7 +95,7 @@ const useStyles = makeStyles((theme) => ({
9395
textAlign: 'right',
9496
},
9597
headerIcon: {
96-
color: theme.palette.secondary.main,
98+
color: theme.palette.grey[300],
9799
verticalAlign: 'sub',
98100
marginRight: '.3em',
99101
},

src-ts/Dashboard/SubscriptionsHistory/data.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ export const subscriptionsHistoryChart = {
1818
label: 'Subscriptions',
1919
fill: false,
2020
data: [1545, 1350, 1270, 1830, 1955, 1865, 2034, 2544, 1956, 2211, 1540, 1670],
21-
yAxisID: 'y1',
21+
yAxisID: 'y',
22+
cubicInterpolationMode: 'monotone',
23+
tension: 0.4,
2224
},
2325
{
26+
fill: true,
2427
backgroundColor: 'rgba(136, 151, 170, 0.1)',
2528
borderColor: '#8897aa',
2629
borderDash: [5, 5],
@@ -40,7 +43,9 @@ export const subscriptionsHistoryChart = {
4043
86895,
4144
],
4245
label: 'Visits',
43-
yAxisID: 'y2',
46+
yAxisID: 'y1',
47+
cubicInterpolationMode: 'monotone',
48+
tension: 0.4,
4449
},
4550
],
4651
labels: [
@@ -59,32 +64,27 @@ export const subscriptionsHistoryChart = {
5964
],
6065
},
6166
options: {
67+
stacked: false,
6268
scales: {
63-
xAxes: [
64-
{
65-
gridLines: { display: false },
66-
ticks: { fontColor: '#aaa', autoSkipPadding: 50 },
67-
},
68-
],
69-
yAxes: [
70-
{
71-
id: 'y1',
72-
gridLines: { display: false },
73-
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
74-
},
75-
{
76-
position: 'right',
77-
id: 'y2',
78-
gridLines: { display: false },
79-
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
80-
},
81-
],
69+
x: {
70+
grid: { display: false },
71+
ticks: { fontColor: '#aaa', autoSkipPadding: 50 },
72+
},
73+
y: {
74+
grid: { display: false },
75+
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
76+
},
77+
y1: {
78+
position: 'right',
79+
grid: { display: false },
80+
ticks: { fontColor: '#aaa', maxTicksLimit: 5 },
81+
},
8282
},
8383
tooltips: {
8484
mode: 'index',
8585
intersect: false,
8686
},
87-
hover: {
87+
interaction: {
8888
mode: 'index',
8989
intersect: false,
9090
},

src-ts/Dashboard/SubscriptionsRecent/SubscriptionsRecent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const useStyles = makeStyles((theme) => ({
9696
textAlign: 'right',
9797
},
9898
headerIcon: {
99-
color: theme.palette.secondary.main,
99+
color: theme.palette.grey[300],
100100
verticalAlign: 'sub',
101101
marginRight: '.3em',
102102
},

0 commit comments

Comments
 (0)