Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/js/usage-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ function createStats(processedData) {
function createTrendChart(processedData) {
const { data, versions, byVersion } = processedData;

// Only show the last 5 versions by default; older ones are hidden but toggleable via legend
const visibleCount = 5;
const hiddenThreshold = versions.length - visibleCount;

const datasets = versions.map((version, index) => {
const versionData = byVersion[version];
const colors = [
Expand All @@ -119,7 +123,8 @@ function createTrendChart(processedData) {
borderColor: color,
backgroundColor: color + '20',
tension: 0.4,
fill: true
fill: true,
hidden: index < hiddenThreshold
};
});

Expand All @@ -144,7 +149,7 @@ function createTrendChart(processedData) {
position: 'top'
},
tooltip: {
mode: 'index',
mode: 'x',
intersect: false
}
},
Expand Down
Loading