Browse Source

Fix tooltip on stacked

pull/8/head
Florian Mounier 13 years ago
parent
commit
f58edcb611
  1. 2
      pygal/__init__.py
  2. 6
      pygal/graph/bar.py
  3. 2
      pygal/js/graph.coffee
  4. 2
      pygal/js/graph.js

2
pygal/__init__.py

@ -16,7 +16,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.9.9'
__version__ = '0.9.11'
from collections import namedtuple
from pygal.graph.bar import Bar

6
pygal/graph/bar.py

@ -63,12 +63,12 @@ class Bar(Graph):
if height < 0:
y = y + height
height = -height
y -= shift
bar = self.svg.node(bars, class_='bar')
self.svg.transposable_node(
bar, 'rect',
x=x,
y=y - shift,
y=y,
rx=self.rounded_bars * 1,
ry=self.rounded_bars * 1,
width=bar_inner_width,
@ -93,7 +93,7 @@ class Bar(Graph):
serie_node['text_overlay'], 'text',
class_='centered',
x=x + bar_inner_width / 2,
y=y - shift
y=y
).text = val if self.print_zeroes or val != '0' else ''
return stack_vals

2
pygal/js/graph.coffee

@ -106,7 +106,7 @@ tooltip = (elt) ->
[current_x, current_y] = (parseInt(s) for s in _tooltip.getAttribute('transform').replace('translate(', '').replace(')', '').split ' ')
return if current_x == x and current_y == y
step = 20
step = 12
x_step = (x - current_x) / step
y_step = (y - current_y) / step
anim_x = current_x

2
pygal/js/graph.js

@ -185,7 +185,7 @@
return _results;
})(), current_x = _ref[0], current_y = _ref[1];
if (current_x === x && current_y === y) return;
step = 20;
step = 12;
x_step = (x - current_x) / step;
y_step = (y - current_y) / step;
anim_x = current_x;

Loading…
Cancel
Save