{"id":2657,"date":"2022-06-22T15:03:28","date_gmt":"2022-06-22T15:03:28","guid":{"rendered":"https:\/\/salientsoft.co.uk\/?p=2657"},"modified":"2022-06-22T15:04:06","modified_gmt":"2022-06-22T15:04:06","slug":"primeng-v13-chart-axes-bleedover-issue","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=2657","title":{"rendered":"PrimeNG V13 Chart Axes Bleedover Issue"},"content":{"rendered":"\n<p>Unfortunately with V13 of PrimeNG and its supported chart.js versions, the axes do not get removed when switching\u00a0 chart types and bleed onto the next chart. It appears that the chart must be destroyed and recreated when changing types &#8211; a refresh or reinit call are not enough, and explicit angular change detector calls don&#8217;t work either, see <strong><a href=\"https:\/\/stackoverflow.com\/questions\/61349644\/changing-chart-js-chart-type-doesnt-remove-older-axis\">here<\/a>.<\/strong><\/p>\n<p>Therefore as just having a single permanent chart and changing its properties fails as above, I&#8217;m explicitly making the chart data undefined to ensure that the *ngIf in the template destroys and recreates the chart. This works fine.<\/p>\n<p>This appears to be a new bug.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unfortunately with V13 of PrimeNG and its supported chart.js versions, the axes do not get removed when switching\u00a0 chart types and bleed onto the next chart. It appears that the chart must be destroyed and recreated when changing types &#8211; a refresh or reinit call are not enough, and explicit angular change detector calls don&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[198,11,209,77],"tags":[13,232,16],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2657"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2657"}],"version-history":[{"count":2,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2657\/revisions"}],"predecessor-version":[{"id":2659,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2657\/revisions\/2659"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}