-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable stacked scales and with reverse option support (#655)
* Change defaults of yMin/Max when missing * adds test case with category scale * adds scale.options.reverse checking * apply review * applies same config between reverse and no reverse scale * applies scale dimensions as default for annotation located by a point * applies reverse logic to line annotation * fixes cc * fixes cc2 * fixes lint * changes documentation * adds note about the breaking changes to migration guide * apply review * changes link to stacked scales * Update docs/guide/migrationV2.md Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
- Loading branch information
1 parent
6bf1a72
commit 17352cd
Showing
30 changed files
with
761 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module.exports = { | ||
tolerance: 0.0055, | ||
config: { | ||
type: 'scatter', | ||
options: { | ||
scales: { | ||
x: { | ||
display: true, | ||
min: -10, | ||
max: 50 | ||
}, | ||
y: { | ||
display: false, | ||
min: -10, | ||
max: 50 | ||
} | ||
}, | ||
plugins: { | ||
annotation: { | ||
annotations: { | ||
first: { | ||
type: 'box', | ||
xMax: 1, | ||
backgroundColor: 'rgba(159, 226, 191, 0.5)', | ||
}, | ||
second: { | ||
type: 'box', | ||
xMax: 30, | ||
xMin: 1, | ||
backgroundColor: 'rgba(255, 191, 0, 0.5)', | ||
}, | ||
third: { | ||
type: 'box', | ||
xMin: 30, | ||
backgroundColor: 'rgba(222, 49, 99, 0.5)', | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module.exports = { | ||
tolerance: 0.0055, | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [0, 0, 0, 0, 0, 0] | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], | ||
}, | ||
y: { | ||
display: false | ||
} | ||
}, | ||
plugins: { | ||
legend: false, | ||
annotation: { | ||
annotations: { | ||
first: { | ||
type: 'box', | ||
xMax: 'February', | ||
backgroundColor: 'rgba(159, 226, 191, 0.5)', | ||
}, | ||
second: { | ||
type: 'box', | ||
xMax: 'April', | ||
xMin: 'February', | ||
backgroundColor: 'rgba(255, 191, 0, 0.5)', | ||
}, | ||
third: { | ||
type: 'box', | ||
xMin: 'April', | ||
backgroundColor: 'rgba(222, 49, 99, 0.5)', | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module.exports = { | ||
tolerance: 0.0055, | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [0, 0, 0, 0, 0, 0] | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], | ||
reverse: true | ||
}, | ||
y: { | ||
display: false | ||
} | ||
}, | ||
plugins: { | ||
legend: false, | ||
annotation: { | ||
annotations: { | ||
first: { | ||
type: 'box', | ||
xMax: 'February', | ||
backgroundColor: 'rgba(159, 226, 191, 0.5)', | ||
}, | ||
second: { | ||
type: 'box', | ||
xMax: 'April', | ||
xMin: 'February', | ||
backgroundColor: 'rgba(255, 191, 0, 0.5)', | ||
}, | ||
third: { | ||
type: 'box', | ||
xMin: 'April', | ||
backgroundColor: 'rgba(222, 49, 99, 0.5)', | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module.exports = { | ||
tolerance: 0.0055, | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [0, 0, 0, 0, 0, 0] | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
display: false, | ||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], | ||
}, | ||
y: { | ||
display: true, | ||
stack: 'demo', | ||
stackWeight: 2, | ||
min: -10, | ||
max: 50 | ||
}, | ||
y2: { | ||
type: 'category', | ||
display: true, | ||
labels: ['ON', 'OFF'], | ||
offset: true, | ||
position: 'left', | ||
stack: 'demo', | ||
stackWeight: 1, | ||
} | ||
}, | ||
plugins: { | ||
legend: false, | ||
annotation: { | ||
annotations: { | ||
first: { | ||
type: 'box', | ||
yScaleID: 'y2', | ||
yMax: 'OFF', | ||
backgroundColor: 'rgba(159, 226, 191, 0.5)', | ||
}, | ||
second: { | ||
type: 'box', | ||
yScaleID: 'y2', | ||
yMin: 'OFF', | ||
backgroundColor: 'rgba(255, 191, 0, 0.5)', | ||
}, | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.