Ngx-charts: The tooltips position is wrong when used with Gridster 2

Created on 3 Mar 2020  路  1Comment  路  Source: swimlane/ngx-charts

Hi,

Has anyone tried to integrate the charts into gridster 2?

https://github.com/tiberiuzuld/angular-gridster2

I'm trying to do this and everything works just fine except the tooltips.

The tooltips position is calculated using getBoundingClientRect() and somehow, when integrated in gridster, the position is wrong.

The gridster items position is based on css transform. This seems to be the problem but not the only one.

I cannot figure out how to make this work.

I hope someone can help.

Thank you.

AG

Bug

Most helpful comment

I have found the solution, just in case someone has the same problem.

Indeed, it's a tooltip position calculation compatibility issue. It doesn't calculate properly if the gridster is using transform to position the elements.

The solution was quite easy.

The gridster has options and one of them is useTransformPositioning.

It was true by default. I've set it to false and it doesn't use transform anymore to position the elements.

The tooltips are working properly now.

>All comments

I have found the solution, just in case someone has the same problem.

Indeed, it's a tooltip position calculation compatibility issue. It doesn't calculate properly if the gridster is using transform to position the elements.

The solution was quite easy.

The gridster has options and one of them is useTransformPositioning.

It was true by default. I've set it to false and it doesn't use transform anymore to position the elements.

The tooltips are working properly now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

merinshaji picture merinshaji  路  3Comments

DZDomi picture DZDomi  路  4Comments

workfel picture workfel  路  3Comments

achimha picture achimha  路  3Comments

NashIlli picture NashIlli  路  3Comments