Skip to content

Commit

Permalink
Add min and max for yAxis from chartModel for trend-chart.js
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsymhoven committed Jun 8, 2022
1 parent b0ccd41 commit cba46c5
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/main/webapp/js/trend-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ EChartsJenkinsApi.prototype.renderConfigurableTrendChart = function (chartDivId,

function createOptions(chartModel) {
const textColor = getComputedStyle(document.body).getPropertyValue('--text-color') || '#333';
let rangeMin;
if (typeof rangeMin === 'undefined' || rangeMin === null) {
rangeMin = 'dataMin';
}
else {
rangeMin = chartModel.rangeMin
}
let rangeMax;
if (typeof rangeMax === 'undefined' || rangeMax === null) {
rangeMax = 'dataMax';
}
else {
rangeMax = chartModel.rangeMax;
}
return {
tooltip: {
trigger: 'axis',
Expand Down Expand Up @@ -87,8 +73,8 @@ EChartsJenkinsApi.prototype.renderConfigurableTrendChart = function (chartDivId,
],
yAxis: [{
type: 'value',
min: rangeMin,
max: rangeMax,
min: chartModel.rangeMin ?? 'dataMin',
max: chartModel.rangeMax ?? 'dataMax',
axisLabel: {
color: textColor
},
Expand Down

0 comments on commit cba46c5

Please sign in to comment.