Skip to content

Commit

Permalink
#7162 Fixed axis labels on dashboard charts
Browse files Browse the repository at this point in the history
  • Loading branch information
exileDev committed May 15, 2024
1 parent ed091ce commit 7893472
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@
display: true,
ticks: {
callback: function (dataLabel, index) {
if (window.customerStatistics && window.customerStatistics.config.data.labels.length > 12) {
return index % 5 === 0 ? dataLabel : '';
}
return dataLabel;
var labels = this.chart.config.data.labels;
return labels.length <= 12 || index % 5 === 0 ? labels[index] : '';
}
},
grid: {
Expand All @@ -100,10 +98,7 @@
y: {
display: true,
ticks: {
callback: function (dataLabel, index) {
return (dataLabel ^ 0) === dataLabel ? dataLabel : '';
},
min: 0
stepSize: 1
},
grid: {
display: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@
display: true,
ticks: {
callback: function (dataLabel, index) {
if (window.orderStatistics && window.orderStatistics.config.data.labels.length > 12) {
return index % 5 === 0 ? dataLabel : '';
}
return dataLabel;
var labels = this.chart.config.data.labels;
return labels.length <= 12 || index % 5 === 0 ? labels[index] : '';
}
},
grid: {
Expand All @@ -99,10 +97,7 @@
y: {
display: true,
ticks: {
callback: function (dataLabel, index) {
return (dataLabel ^ 0) === dataLabel ? dataLabel : '';
},
min: 0
stepSize: 1
},
grid: {
display: true,
Expand Down

0 comments on commit 7893472

Please sign in to comment.