Nivo: Changing Pie legend text color

Created on 8 Aug 2018  Â·  3Comments  Â·  Source: plouc/nivo

How do I change the text color in the legend of the nivo/pie chart?

Most helpful comment

If anyone finds this via Google like I did and it isn't working for them (I was using a ResponsiveLineChart - not sure if that was my issue), then maybe this will help:

legends={[
    {
        "anchor": "top-right",
        "direction": "column",
        "translateY": -25,
        "translateX": 100,
        "itemWidth": 100,
        "itemHeight": 48.2,
        "symbolSize": 12,
        "symbolShape": "circle",
        "itemTextColor": "#eee", // <= this worked for me in the end
    },
]}

All 3 comments

You can set text color like this:

             legends={[
                 {
                     "anchor": "top-right",
                     "direction": "column",
                     "translateY": -25,
                     "translateX": 100,
                     "itemWidth": 100,
                     "itemHeight": 48.2,
                     "symbolSize": 12,
                     "symbolShape": "circle",
                     "textColor": '#eee'
                 }
             ]}

Thank you!

On Fri, Aug 10, 2018 at 3:22 AM, Tomasz Panek notifications@github.com
wrote:

You can set text color like this:
legends={[
{
"anchor": "top-right",
"direction": "column",
"translateY": -25,
"translateX": 100,
"itemWidth": 100,
"itemHeight": 48.2,
"symbolSize": 12,
"symbolShape": "circle",
"textColor": '#eee'
}
]}

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/plouc/nivo/issues/257#issuecomment-411884753, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AaCgh1cG9J-spD1F4zUbdzrsIoiXUUo-ks5uPJnygaJpZM4VzVdX
.

If anyone finds this via Google like I did and it isn't working for them (I was using a ResponsiveLineChart - not sure if that was my issue), then maybe this will help:

legends={[
    {
        "anchor": "top-right",
        "direction": "column",
        "translateY": -25,
        "translateX": 100,
        "itemWidth": 100,
        "itemHeight": 48.2,
        "symbolSize": 12,
        "symbolShape": "circle",
        "itemTextColor": "#eee", // <= this worked for me in the end
    },
]}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dubzzz picture dubzzz  Â·  3Comments

KENNYSOFT picture KENNYSOFT  Â·  3Comments

p45mark picture p45mark  Â·  3Comments

cedmax picture cedmax  Â·  4Comments

vagnervst picture vagnervst  Â·  4Comments