mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Updated dashboard totals chart ticks
- set 30 days to show every other gridline - set 90 days to show every 3rd gridline Note that this required to add an extra day to the displayed number of days.
This commit is contained in:
parent
2d4bbad094
commit
c2b49028f1
2 changed files with 17 additions and 4 deletions
|
@ -9,15 +9,16 @@ import {tracked} from '@glimmer/tracking';
|
|||
|
||||
const DATE_FORMAT = 'D MMM, YYYY';
|
||||
|
||||
// Options 30 and 90 need an extra day to be able to distribute ticks/gridlines evenly
|
||||
const DAYS_OPTIONS = [{
|
||||
name: '7 Days',
|
||||
value: 7
|
||||
}, {
|
||||
name: '30 Days',
|
||||
value: 30
|
||||
value: 30 + 1
|
||||
}, {
|
||||
name: '90 Days',
|
||||
value: 90
|
||||
value: 90 + 1
|
||||
}];
|
||||
|
||||
const DISPLAY_OPTIONS = [{
|
||||
|
@ -233,6 +234,7 @@ export default class Anchor extends Component {
|
|||
}
|
||||
|
||||
get chartOptions() {
|
||||
let activeDays = this.days;
|
||||
let barColor = this.feature.nightShift ? 'rgba(200, 204, 217, 0.25)' : 'rgba(200, 204, 217, 0.65)';
|
||||
|
||||
return {
|
||||
|
@ -338,7 +340,18 @@ export default class Anchor extends Component {
|
|||
if (index === (values.length - 1)) {
|
||||
document.getElementById('gh-dashboard5-anchor-date-end').innerHTML = moment(value).format(DATE_FORMAT);
|
||||
}
|
||||
return value;
|
||||
|
||||
if (activeDays === (30 + 1)) {
|
||||
if (!(index % 2)) {
|
||||
return value;
|
||||
}
|
||||
} else if (activeDays === (90 + 1)) {
|
||||
if (!(index % 3)) {
|
||||
return value;
|
||||
}
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
|
|
@ -135,7 +135,7 @@ export default class DashboardStatsService extends Service {
|
|||
* @type {number|'all'}
|
||||
* Amount of days to load for member count and MRR related charts
|
||||
*/
|
||||
@tracked chartDays = 30;
|
||||
@tracked chartDays = 30 + 1;
|
||||
|
||||
/**
|
||||
* Filter last seen by this status
|
||||
|
|
Loading…
Add table
Reference in a new issue