This example gives an error, because y1 is not explicitly set for the Area mark:
<Plot
height={300}
marginLeft={60}
y={{ axis: null }}
x={{ nice: true }}
fy={{ domain: ['FEMALE', 'MALE'] }}
color={{ legend: true }}
facet={{ data: penguins, y: 'sex' }}>
<AreaY
{...binX(
{
data: penguins,
x: 'culmen_length_mm',
fill: 'species',
fillOpacity: '.',
thresholds: '',
curve: 'natural',
},
{ y2: 'count' }
)} />
</Plot>
Whereas it works if y1: 0 is added:
<Plot
height={300}
marginLeft={60}
y={{ axis: null }}
x={{ nice: true }}
fy={{ domain: ['FEMALE', 'MALE'] }}
color={{ legend: true }}
facet={{ data: penguins, y: 'sex' }}>
<AreaY
{...binX(
{
data: penguins,
x: 'culmen_length_mm',
fill: 'species',
fillOpacity: '.',
thresholds: '',
curve: 'natural',
y1: 0
},
{ y2: 'count' }
)} />
</Plot>
It also works if I specify y rather than y1:
<Plot
height={300}
marginLeft={60}
y={{ axis: null }}
x={{ nice: true }}
fy={{ domain: ['FEMALE', 'MALE'] }}
color={{ legend: true }}
facet={{ data: penguins, y: 'sex' }}>
<AreaY
{...binX(
{
data: penguins,
x: 'culmen_length_mm',
fill: 'species',
fillOpacity: '.',
thresholds: '',
curve: 'natural',
},
{ y: 'count' }
)} />
</Plot>
In Observable Plot, setting just y2 works (as in this example).
(this is one of the issues surfaced by #72)
This example gives an error, because
y1is not explicitly set for the Area mark:Whereas it works if
y1: 0is added:It also works if I specify
yrather thany1:In Observable Plot, setting just
y2works (as in this example).(this is one of the issues surfaced by #72)