PrimeFaces chart element cannot be made responsive #2640
-
In order for a Chart.js element to be responsive it must be the only child of a div element that is relatively positioned. However, the PrimeFaces p:chart element renders without the style 'position: relative', and so it seems like it cannot be responsive. Is there a solution to this problem? |
Beta Was this translation helpful? Give feedback.
Answered by
SkylerMime
Sep 9, 2024
Replies: 1 comment 6 replies
-
so why not just do |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That was the first thing I tried, but unfortunately p:chart renders as two elements (a canvas inside a div), and the style attributes get passed to the canvas instead of to the div, where they need to be in order for the chart to be responsive.
Source:
Renders as:
But I would need it to render something like this (from the documentation):