unifyviz
unifyvizwarm
unify8Colors
cybertron
OrRd
PuBu
BuPu
Oranges
BuGn
YlOrBr
YlGn
Reds
RdPu
Greens
YlGnBu
Purples
GnBu
Greys
YlOrRd
PuRd
Blues
PuBuGn
Viridis
Spectral
RdYlGn
RdBu
PiYG
PRGn
RdYlBu
BrBG
RdGy
PuOr
Set2
Accent
Set1
Set3
Dark2
Paired
Pastel2
Pastel1
orrd
pubu
bupu
oranges
bugn
ylorbr
ylgn
reds
rdpu
greens
ylgnbu
purples
gnbu
greys
ylorrd
purd
blues
pubugn
viridis
spectral
rdylgn
rdbu
piyg
prgn
rdylbu
brbg
rdgy
puor
set2
accent
set1
set3
dark2
paired
pastel2
pastel1
Using Color Schemes
To apply a color scheme to your chart, simply set the colorScheme
attribute to the desired scheme. For example:
import { BarChart } from 'reaviz';
const data = [
{ key: 'DLP', data: 13 },
{ key: 'SIEM', data: 2 },
{ key: 'Endpoint', data: 7 }
];
<BarChart data={data} colorScheme="unifyviz" />;
This will render your chart using the βunifyvizβ color scheme.
Using callback for Colors
You can also use a function callback to determine the color of each data point. For example:
import { BarChart } from 'reaviz';
const data = [
{ key: 'DLP', data: 10 },
{ key: 'SIEM', data: 20 },
{ key: 'Endpoint', data: 70 },
{ key: 'Network', data: 40 },
{ key: 'Cloud', data: 30 },
{ key: 'Other', data: 80 }
];
<BarChart
data={data}
series={
<BarSeries colorScheme={(item, index) => (item.data > 50 ? '#418AD7' : '#ACB7C9')}
/>}
/>;
The type for the color scheme is:
type ColorSchemeType =
| ((data, index: number, active?: any[]) => string)
| string[]
| string;
This will render your chart using a function callback to determine the color of each data point.
Last updated on