-
-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request