[Patternfly] Help with Donut Chart

Dan Labrecque dlabrecq at redhat.com
Thu Jul 21 18:08:24 UTC 2016


This appears to be a known issue with C3 charts. I ran into a similar 
scenario myself while creating the new Patternfly web site.

When switching between tabs, the charts shown need to be refreshed 
manually. From what I've read, firing a resize event seems to be the 
recommended way to refresh C3 charts.

FYI, this is the JS I'm using to solve our particular problem. Whenever 
the tab is toggled, a resize event is fired, and the C3 chart is refreshed.

<script>
     // Workaround for bug with hidden C3 charts in v0.4.11. $(document).on('shown.bs.tab','a[data-toggle="tab"]',function () {
         if (window.dispatchEvent) {
             window.dispatchEvent(new Event('resize'));
         }
         // Special case for IE if ($(document).fireEvent) {
             $(document).fireEvent('onresize');
         }
     });
</script>


Dan

On 7/21/16 12:16 PM, Ju Lim wrote:
> Hi.  I'm not sure who to ask, but an issue came up with the donut 
> chart.  Specifically in looking at 
> https://bugzilla.redhat.com/show_bug.cgi?id=1357447, it appears the 
> donut chart does not get refreshed automatically.
>
> Problem:
> USM, the donut chart is rendered on the page, but let's say the 
> utilization values change or whenever there's an update, the donut is 
> not re-drawn with the updated value unless the User forces a manual 
> refresh.
>
> Issue:
> USM is using angular-patternfly (which sits on top of a c3 chart), and 
> there appears to be no re-draw function in there, and the c3 chart 
> does have the redraw function. Right now, the angular-patternfly does 
> not provide any control over this redraw function.
>
> Who's the right contact who can provide guidance on this please?  
> Please advise.
>
> Thank you,
> Ju
>
>
>
>
> _______________________________________________
> Patternfly mailing list
> Patternfly at redhat.com
> https://www.redhat.com/mailman/listinfo/patternfly

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/patternfly/attachments/20160721/cc1d576f/attachment.htm>


More information about the PatternFly mailing list