reactjschartsnivo-react

Why Legend's text in Nivo Bar Charts doesn't show


I am trying to use this library for charts in React: https://nivo.rocks/

I have copied the exact same example in the docs for the horizontal column chart (bar chart) but on my env, the legends are simply not shown.

I have looked for all other issues previously posted concerning labels not showing up and legend's problems troubleshoot. But this is a different issue. it just doesn't work as expected / as shown in the documentation live preview

CodeSandbox showing the problem: https://codesandbox.io/s/missing-legends-text-pns6v

enter image description here


Solution

  • There is a div tag that looks like this:

    <div style={{ width: "80%", height: "400px", color: "white" }}>
    

    The colour is set to white. Remove that, and the text will display.