How can I use width and height for a PrimeNg chart?
<p-chart type="bar" width="400" height="400" [data]="data"></p-chart>
There is no effect when I use width and height. Please let me know how to use the width and height chart.
https://www.reddit.com/r/webdev/comments/4gjuvp/chartjs_canvas_height_width_ignored/
According to this link you should set two parameters for the chart:
<p-chart type="bar" width="400" height="400" [data]="data" [options]="options"></p-chart>
And in Typescript code, Code:
options = { responsive: false, maintainAspectRatio: false };
Looking through the source code , p-chart takes the width and height as component inputs, so including them in [] should do the trick
<p-chart type="bar" [width]="400" [height]="400" [data]="data"></p-chart>
Source: https://habr.com/ru/post/1661425/More articles:Symfony2, unable to log in, maybe the reason is the translation? - phpThe best way to parse a large and running Json file with OpenRefine (or R) - jsonIs it possible to get a word under the mouse cursor in ` `? - javascript Error: Imported targets are not available for Boost version - c ++ Waiting for a cloned child assembly with sysall - assembly Do you run std :: string at '\ 0' when initialized with a string literal? - c ++ Excluded HTML objects in attribute selectors - html Why does the waitid block not end until the child completes the action? - linux Uncaught TypeError: ะะต ัะดะฐะตััั ะฟัะพัะธัะฐัั ัะฒะพะนััะฒะพ 'axis' of undefined - javascript https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1661430/htmlcss-how-to-apply-css-to-a-with-custom-data-attribute&usg=ALkJrhgOPckTc-vNTKP9fs6v1D5jKB6ozw All Articles