How to add custom color theme in nivo chart settings

Viewed 3458

I am using Nivo charts in one of my projects and I have implemented nivo chart settings as they have implemented them in their website. However, I wanted to add a few of my own custom color theme options additional to what nivo provides. For more clarity, I am attaching this screenshot enter image description here

Right now, we import colors from nivo package as

import {
    categoricalColorSchemeIds,
    divergingColorSchemeIds,
    sequentialColorSchemeIds,
    colorSchemes,
} from '@nivo/colors'

now I read somewhere that we can inject our custom object as color theme, can anyone help me show as how it would be possible if for ex I want to add new theme with name CustomTheme with colors of "#000, #fff ,#ff0000". How would we do that, any help would be helpful. Thanks in advance

1 Answers

Do:

colors={['#111111', '#222222']}
colorBy="index"
Related