Skip to content

Commit

Permalink
Update chart_compare.js
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh authored Jan 8, 2025
1 parent 7663fda commit c56348e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions javascripts/chart_compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,22 @@ function drawPerformanceChart(scenario, { values1, values2 }) {
fontColor: "rgba(0,0,0,0.1)"
}],
axisX: {
labelFormatter: function(e) { return (""+e.label).substring(0, 75); },
labelAngle: 0
intervalType: "String",
valueFormatString: " ",
labelAngle: 35,
labelTextAlign: "center",
labelMaxWidth: 80,
labelFormatter: function(e) {
let label = e.label.toString();
let maxLength = 15; // Max characters per line
let wrappedLabel = '';

// Wrap the label by adding \n at every maxLength interval
for (let i = 0; i < label.length; i += maxLength) {
wrappedLabel += label.substring(i, i + maxLength) + "\n";
}
return wrappedLabel;
}
},
axisY: {
title: ytitle[scenario],
Expand Down

0 comments on commit c56348e

Please sign in to comment.