gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

Tooltip problem with Flex display #196

Open seltix5 opened 6 years ago

seltix5 commented 6 years ago

hi,

There is a problem with the tooltip when using flex body. Simple example here :

https://codepen.io/seltix/pen/pWXmEo

body {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 100vh;
  padding: 50px;
}

<span class="sparkline">5,9,1,2,3,6,5,8,7,5,9,10</span>

jQuery(".sparkline").sparkline();

image

Apparently, changing the Tooltip createClass style position from "static" to "absolute" will solve the problem but i dont know it will cause other problems else where...

thanks.

crico commented 6 years ago

How did you resolve the bug? changing position from "static" to ???, thanks!

seltix5 commented 6 years ago

hello, sorry for the type error. so, I changed the CSS in this line https://github.com/gwatts/jquery.sparkline/blob/657f42892ee384691e2540fae1f04058da4145d5/src/interact.js#L139

position: static !important; => position: absolute !important;

crico commented 6 years ago

Thanks for answering so quickly. My problem was really this: https://github.com/gwatts/jquery.sparkline/issues/173, but I think that it is related with Flex too.