britecharts-react icon indicating copy to clipboard operation
britecharts-react copied to clipboard

Tooltip with StackedBar not being rendered

Open juanpaucar opened this issue 6 years ago • 10 comments

Expected Behavior

When I add a Tooltip for a StackedBar, I expect the tooltip being rendered along with the chart. This is also happening to me on Bar charts.

Current Behavior

The tooltip is not being rendered. I created a small pen to show you the behavior. I started from a similar pen which worked for Line charts.

The chart is being rendered, but the tooltip is not being rendered.

Possible Solution

Not sure, if it's not implemented yet or if it should be rendered but I'm missing something. I thought that the tooltip worked since on the documentation there's this mention:

The tooltip component is a great companion to the line, stacked area, stacked bar and grouped bar charts.

Steps to Reproduce (for bugs)

Please, check this pen: https://codepen.io/juanpaucar/pen/maJrgQ

Screenshots (if appropriate):

Context

I just started using this charts and it seemed weird to me that they don't work for Bar and Stacked Bar.

Your Environment

Ubuntu 18.04 Node 10.13.0 Britecharts and Britecharts-react latests versions https://codepen.io/juanpaucar/pen/maJrgQ

juanpaucar avatar Dec 11 '18 17:12 juanpaucar

Hi @juanpaucar, thanks for opening this issue!

I just noticed we don't have an example of this in the docs. In theory, it should work but I don't discard there is an issue somewhere.

I will try to work it out in the demos and then come back to you here.

Thanks again!

Golodhros avatar Dec 12 '18 01:12 Golodhros

Hi, thank you guys for the wrapper and the library itself. I thought I was doing something wrong... or am I 🤔

juanpaucar avatar Dec 12 '18 02:12 juanpaucar

I can confirm that the tooltip is not being rendered with the StackedBar chart and is not throwing any error either. Gonna take a look.

davegomez avatar Dec 12 '18 19:12 davegomez

@Golodhros this should be mark as a bug.

I've been playing with the charts and found that GroupedBar and StackedBar are not calling componentDidUpdate after the initial render, so the method createTooltip is never called for these charts.

davegomez avatar Dec 16 '18 12:12 davegomez

Thanks for the debugging @davegomez!!

Golodhros avatar Dec 16 '18 17:12 Golodhros

Is there a way to do this then? I might look for a different solution if this library is not complete...

Dezzymei avatar Mar 11 '19 11:03 Dezzymei

This is already fixed in the PR #163

davegomez avatar Jul 18 '19 00:07 davegomez

It seems we still have some issues. If you check on https://eventbrite.github.io/britecharts-react/#!/StackedBar/5, the tooltip only shows when we are hovering outside the stacked bars.

Golodhros avatar Jul 18 '19 04:07 Golodhros

This is a good case for "it was working for me"... gonna take a look on that today. Thanks for the demo 🙂 @Golodhros

davegomez avatar Jul 18 '19 12:07 davegomez

Thanks a lot @davegomez! You are really making a dent in Britecharts-React!

Golodhros avatar Jul 18 '19 16:07 Golodhros