Removed tick lines for All Time on totals chart and adjusted bar thickness depending on days selected for Paid Subscribers

refs: https://github.com/TryGhost/Team/issues/1531
This commit is contained in:
James Morris 2022-05-10 16:40:28 +01:00
parent 2b4e80b3dd
commit 917f17b7e6
2 changed files with 16 additions and 5 deletions

View File

@ -225,6 +225,7 @@ export default class Anchor extends Component {
}
get chartOptions() {
let isAllTime = (this.days === 'all');
let barColor = this.feature.nightShift ? 'rgba(200, 204, 217, 0.25)' : 'rgba(200, 204, 217, 0.65)';
return {
@ -315,15 +316,20 @@ export default class Anchor extends Component {
},
ticks: {
display: false,
beginAtZero: true,
autoSkip: false,
callback: function (value, index, values) {
if (index === 0) {
document.getElementById('gh-dashboard5-anchor-date-start').innerHTML = moment(value).format(DATE_FORMAT);
return value;
}
if (index === values.length - 1) {
if (index === (values.length - 1)) {
document.getElementById('gh-dashboard5-anchor-date-end').innerHTML = moment(value).format(DATE_FORMAT);
return value;
}
return value;
if (!isAllTime) {
return value;
}
return null;
}
}
}]

View File

@ -60,7 +60,13 @@ export default class PaidBreakdown extends Component {
const labels = stats.map(stat => stat.date);
const newData = stats.map(stat => stat.positiveDelta);
const canceledData = stats.map(stat => -stat.negativeDelta);
const barThickness = 5;
let barThickness = 5;
if (newData.length > 30) {
barThickness = 2;
} else if (newData.length > 90) {
barThickness = 1;
}
return {
labels: labels,
@ -162,7 +168,6 @@ export default class PaidBreakdown extends Component {
},
ticks: {
display: false,
maxTicksLimit: 5,
fontColor: '#7C8B9A',
padding: 8,
precision: 0