mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-09 17:56:51 +01:00
Remove unused xOffset property from the tooltip. Use the multiKeyBackground. Update documentation accordingly.
This commit is contained in:
@@ -127,8 +127,7 @@ xPadding | Number | 6 | Padding to add on top and bottom of tooltip
|
||||
yPadding | Number | 6 | Padding to add on left and right of tooltip
|
||||
caretSize | Number | 5 | Size, in px, of the tooltip arrow
|
||||
cornerRadius | Number | 6 | Radius of tooltip corner curves
|
||||
xOffset | Number | 10 |
|
||||
multiKeyBackground | Color | "#fff" |
|
||||
multiKeyBackground | Color | "#fff" | Color to draw behind the colored boxes when multiple items are in the tooltip
|
||||
| | |
|
||||
callbacks | - | - | V2.0 introduces callback functions as a replacement for the template engine in v1. The tooltip has the following callbacks for providing text. For all functions, 'this' will be the tooltip object create from the Chart.Tooltip constructor
|
||||
**Callback Functions** | | | All functions are called with the same arguments
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
xPadding: 6,
|
||||
caretSize: 5,
|
||||
cornerRadius: 6,
|
||||
xOffset: 10,
|
||||
multiKeyBackground: '#fff',
|
||||
callbacks: {
|
||||
// Args are: (tooltipItems, data)
|
||||
@@ -98,7 +97,6 @@
|
||||
// Positioning
|
||||
xPadding: options.tooltips.xPadding,
|
||||
yPadding: options.tooltips.yPadding,
|
||||
xOffset: options.tooltips.xOffset,
|
||||
|
||||
// Body
|
||||
bodyColor: options.tooltips.bodyColor,
|
||||
@@ -467,7 +465,7 @@
|
||||
// Draw Legend-like boxes if needed
|
||||
if (this._options.tooltips.mode != 'single') {
|
||||
// Fill a white rect so that colours merge nicely if the opacity is < 1
|
||||
ctx.fillStyle = helpers.color('#FFFFFF').alpha(opacity).rgbaString();
|
||||
ctx.fillStyle = helpers.color(vm.legendColorBackground).alpha(opacity).rgbaString();
|
||||
ctx.fillRect(xBase, yBase, vm.bodyFontSize, vm.bodyFontSize);
|
||||
|
||||
// Border
|
||||
|
||||
Reference in New Issue
Block a user