mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 00:14:03 +01:00
Merge pull request #2116 from 100000001/v2.0-dev
Expose yAlign and xAlign as a tooltip option
This commit is contained in:
@@ -24,6 +24,8 @@ module.exports = function(Chart) {
|
||||
footerAlign: "left",
|
||||
yPadding: 6,
|
||||
xPadding: 6,
|
||||
yAlign : 'center',
|
||||
xAlign : 'center',
|
||||
caretSize: 5,
|
||||
cornerRadius: 6,
|
||||
multiKeyBackground: '#fff',
|
||||
@@ -88,6 +90,8 @@ module.exports = function(Chart) {
|
||||
// Positioning
|
||||
xPadding: options.tooltips.xPadding,
|
||||
yPadding: options.tooltips.yPadding,
|
||||
xAlign : options.tooltips.yAlign,
|
||||
yAlign : options.tooltips.xAlign,
|
||||
|
||||
// Body
|
||||
bodyColor: options.tooltips.bodyColor,
|
||||
@@ -333,8 +337,6 @@ module.exports = function(Chart) {
|
||||
return size;
|
||||
},
|
||||
determineAlignment: function determineAlignment(size) {
|
||||
this._model.xAlign = this._model.yAlign = "center";
|
||||
|
||||
if (this._model.y < size.height) {
|
||||
this._model.yAlign = 'top';
|
||||
} else if (this._model.y > (this._chart.height - size.height)) {
|
||||
|
||||
Reference in New Issue
Block a user