You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-8
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,9 @@ __Important!__ You need to set flot option `hoverable` to `true` if you want flo
30
30
31
31
In comments there are default values
32
32
33
-
tooltip: boolean //false
34
-
tooltipOpts: {
35
-
id: string //"flotTip"
33
+
tooltip: {
34
+
show: boolean //false
35
+
cssClass: string //"flotTip"
36
36
content: string or function //"%s | X: %x | Y: %y"
37
37
xDateFormat: string //null
38
38
yDateFormat: string //null
@@ -45,16 +45,17 @@ In comments there are default values
45
45
defaultTheme: boolean //true
46
46
lines: boolean //false
47
47
onHover: function(flotItem, $tooltipEl)
48
-
compat: boolean //false
48
+
$compat: boolean //false
49
49
}
50
50
51
51
52
-
-`tooltip` : set to `true` to turn on this plugin (if `grid.hoverable` is also set to `true`)
53
-
-`id` : the id to assign to the tooltip's HTML DIV element, defaulted to "flotTip"
52
+
-`show` : set to `true` to turn on this plugin (if `grid.hoverable` is also set to `true`)
53
+
-`cssClass` : the class to assign to the tooltip's HTML DIV element, defaulted to "flotTip"
54
54
-`content` : content of your tooltip, HTML tags are also allowed; use `%s` for series label, `%x` for X value, `%y` for Y value and `%p` for percentage value (useful with pie charts using flot.pie plugin)
55
-
With `%x`, `%y` and `%p` values you can also use `.precision`, for example `%x.2` means that value of X will be rounded to 2 digits after the decimal point.
55
+
With `%x`, `%y` and `%p` values you can also use `.precision`, for example `%x.2` means that value of X will be rounded to 2 digits after the decimal point.
56
56
If no precision or dateFormat is set then plugin uses tickFormatter to format values displayed on tooltip.
57
57
If you require even more control over how the tooltip is generated you can pass a callback `function(label, xval, yval, flotItem)` that must return a string with the format described.
58
+
The content callback function pass may also return a boolean value of false (or empty string) if the tooltip is to be hidden for the given data point.
58
59
Pull request [#64](https://github.com/krzysu/flot.tooltip/pull/64) introduced two more placeholders `%lx` and `%ly`, that work with flot-axislabels plugin.
59
60
Pull request [#75](https://github.com/krzysu/flot.tooltip/pull/75) introduced `%ct` placeholder for any custom text withing label (see example in `examples/custom-label-text.html`)
60
61
-`xDateFormat` : you can use the same specifiers as in Flot, for time mode data
@@ -89,7 +90,17 @@ when the pull request is merged and how many other changes were made at the same
89
90
## Changelog
90
91
91
92
92
-
### What's new in v0.8.4?
93
+
### What's new in v0.8.5?
94
+
95
+
- IMPORTANT NOTE A: while a legacy check exists, the options object format has changed to be a single object `tooltip` with a property `show` (defaulted to false). The legacy check may not always exist, so it may be a good idea to update your production code.
96
+
- IMPORTANT NOTE B: while there's a legacy check for the options object, there is not one for the id-to-class change (see below). This change will be far less relevant to developers, as it only matters when adding custom CSS styling. If your implementation does so, make sure you change your selectors with the new version!
- improved line tracking feature - now utilizes flot's plot object's grid.mouseActiveRadius option for threshold and is based off pixel distance instead of data.
100
+
- changed the id option to cssClass instead. This means the option is now cssClass instead of id, and will (obviously) be assigned as a class instead of an id. Therefore, any relevant CSS selectors need to be changed as well.
101
+
- added fix that should allow x axis value to work properly in some multiple-series implementations
0 commit comments