Skip to content

Commit fe97782

Browse files
author
Krzysztof Urbas
committed
prepare 0.8.7 release
1 parent 2e2f51d commit fe97782

File tree

5 files changed

+39
-31
lines changed

5 files changed

+39
-31
lines changed

README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can also use bower package manager:
2323
__Important!__ You need to set flot option `hoverable` to `true` if you want flot.tooltip plugin to work.
2424

2525
grid: {
26-
hoverable: true
26+
hoverable: true
2727
}
2828

2929
### Plugin Options
@@ -50,15 +50,15 @@ In comments there are default values
5050

5151

5252
- `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"
53+
- `cssClass` : the class to assign to the tooltip's HTML DIV element, defaulted to "flotTip"
5454
- `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)
5555
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.
5656
If no precision or dateFormat is set then plugin uses tickFormatter to format values displayed on tooltip.
5757
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.
5858
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.
5959
Pull request [#64](https://github.com/krzysu/flot.tooltip/pull/64) introduced two more placeholders `%lx` and `%ly`, that work with flot-axislabels plugin.
6060
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`)
61-
Pull request [#112](https://github.com/krzysu/flot.tooltip/pull/112) introduced `%n` placeholder for the total number (rather than percent) represented by a single slice of a pie chart.
61+
Pull request [#112](https://github.com/krzysu/flot.tooltip/pull/112) introduced `%n` placeholder for the total number (rather than percent) represented by a single slice of a pie chart.
6262
- `xDateFormat` : you can use the same specifiers as in Flot, for time mode data
6363
- `yDateFormat` : you can use the same specifiers as in Flot, for time mode data
6464
- `monthNames` : check [#28](https://github.com/krzysu/flot.tooltip/issues/28)
@@ -78,7 +78,7 @@ In comments there are default values
7878
- [tickRotor](https://github.com/markrcote/flot-tickrotor)
7979
- [stackpercent](https://github.com/skeleton9/flot.stackpercent)
8080
- [time] (http://www.flotcharts.org/flot/examples/axes-time/index.html)
81-
- [curvedLines] (http://curvedlines.michaelzinsmaier.de/)
81+
- [curvedLines] (http://curvedlines.michaelzinsmaier.de/)
8282

8383
## For developers/contributors
8484

@@ -92,6 +92,10 @@ when the pull request is merged and how many other changes were made at the same
9292

9393
## Changelog
9494

95+
### v0.8.7
96+
97+
- merged pull request: [#138](https://github.com/krzysu/flot.tooltip/pull/138),
98+
9599
### v0.8.6
96100

97101
- pull requests from the community since May 2015
@@ -166,7 +170,7 @@ when the pull request is merged and how many other changes were made at the same
166170

167171
### v0.6 and v0.6.1
168172

169-
- nothing from user perspective :)
173+
- nothing from user perspective :)
170174
- another refactoring, `FlotTooltip` object structure changed to allow many instances to fix issue #13 (regression after v0.5 refactoring)
171175

172176
### v0.5.1
@@ -204,7 +208,7 @@ when the pull request is merged and how many other changes were made at the same
204208
### v0.4
205209

206210
Now you can easily set precision of values displayed on tip thanks to enhanced _string formatter_.
207-
Just put your desired precision after value in format like this `%x.precision`,
211+
Just put your desired precision after value in format like this `%x.precision`,
208212
where _precision_ is a number of digits to appear after the decimal point. It uses `number.toFixed(precision)` function internally.
209213

210214
What is more _string formatter_ was rewritten and now is RegExp based.
@@ -257,8 +261,9 @@ From now on also minified version is available.
257261
- [@willianganzert](https://github.com/willianganzert) - pull request [#83](https://github.com/krzysu/flot.tooltip/pull/83), Add "id" to tooltip element
258262
- [@larsenmtl](https://github.com/larsenmtl) - pull request [#85](https://github.com/krzysu/flot.tooltip/pull/85), Support for stacked percent plugin
259263
- [@RoboterHund](https://github.com/RoboterHund) - pull request [#87](https://github.com/krzysu/flot.tooltip/pull/86), Compatibility fix for older versions of jQuery
264+
- and many more, check merged pull requests
260265

261266
* * *
262-
Copyright (c) 2011-2014 Krzysztof Urbas (@krzysu) & Evan Steinkerchner (@Roundaround).
267+
Copyright (c) 2011-2016 Krzysztof Urbas (@krzysu) & Evan Steinkerchner (@Roundaround).
263268

264269
__jquery.flot.tooltip__ is available under the MIT license.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flot.tooltip",
3-
"version": "0.8.6",
3+
"version": "0.8.7",
44
"license": "MIT",
55
"main": "js/jquery.flot.tooltip.js",
66
"ignore": [

js/jquery.flot.tooltip.js

+22-19
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* jquery.flot.tooltip
33
*
44
* description: easy-to-use tooltips for Flot charts
5-
* version: 0.8.6
5+
* version: 0.8.7
66
* authors: Krzysztof Urbas @krzysu [myviews.pl],Evan Steinkerchner @Roundaround
77
* website: https://github.com/krzysu/flot.tooltip
88
*
9-
* build on 2016-02-25
9+
* build on 2016-03-15
1010
* released under MIT License, 2012
1111
*/
1212
(function ($) {
@@ -326,23 +326,26 @@
326326
* @return jQuery object
327327
*/
328328
FlotTooltip.prototype.getDomElement = function () {
329-
var $tip = $('.' + this.tooltipOptions.cssClass);
330-
331-
if( $tip.length === 0 ){
332-
$tip = $('<div />').addClass(this.tooltipOptions.cssClass);
333-
$tip.appendTo('body').hide().css({position: 'absolute'});
334-
335-
if(this.tooltipOptions.defaultTheme) {
336-
$tip.css({
337-
'background': '#fff',
338-
'z-index': '1040',
339-
'padding': '0.4em 0.6em',
340-
'border-radius': '0.5em',
341-
'font-size': '0.8em',
342-
'border': '1px solid #111',
343-
'display': 'none',
344-
'white-space': 'nowrap'
345-
});
329+
var $tip = $('<div>');
330+
if (this.tooltipOptions && this.tooltipOptions.cssClass) {
331+
$tip = $('.' + this.tooltipOptions.cssClass);
332+
333+
if( $tip.length === 0 ){
334+
$tip = $('<div />').addClass(this.tooltipOptions.cssClass);
335+
$tip.appendTo('body').hide().css({position: 'absolute'});
336+
337+
if(this.tooltipOptions.defaultTheme) {
338+
$tip.css({
339+
'background': '#fff',
340+
'z-index': '1040',
341+
'padding': '0.4em 0.6em',
342+
'border-radius': '0.5em',
343+
'font-size': '0.8em',
344+
'border': '1px solid #111',
345+
'display': 'none',
346+
'white-space': 'nowrap'
347+
});
348+
}
346349
}
347350
}
348351

0 commit comments

Comments
 (0)