remove pie chart, but keep it's functional legend

30 views
Skip to first unread message

Robert James Liguori

unread,
May 22, 2017, 5:17:26 PM5/22/17
to dc-js user group
Here, I have another unusual request...

I'd like to remove (or hide) the pie chart but keep/show it's legend, and keep the legend functional.

How may I do this?!?

Thanks,
Robert

Gordon Woodhull

unread,
May 22, 2017, 5:30:46 PM5/22/17
to dc.js user group
Right, so it's just an ordinal select widget... We've thought about making the legend its own chart for this purpose. 

(People also use row charts for this sometimes.)

I think the cleanest way to do it is to hide the elements and disable pointer events for them:

      .dc-chart g.pie-slice-group, .dc-chart g.pie-label-group {
        visibility: hidden;
        pointer-events: none;
      }



--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/257da6c1-f3fd-4dac-9da3-6fa592809191%40googlegroups.com.

Robert James Liguori

unread,
May 22, 2017, 5:37:16 PM5/22/17
to dc-js user group
that works... but I have two pie charts, how do I use it for just one of the two... as this in the head/style works for both...

robert

Gordon Woodhull

unread,
May 22, 2017, 5:39:59 PM5/22/17
to dc.js user group
it's just regular css, so use a more specific selector like 

#year-chart g.pie-slice-group, #year-chart g.pie-label-group

where "year-chart" is the id of the chart you want to hide


Robert James Liguori

unread,
May 22, 2017, 5:44:10 PM5/22/17
to dc-js user group
Thank you so much for taking the time to explain this to me.

Robert 
Reply all
Reply to author
Forward
0 new messages