Reputation: 2908
I am working directly on the example from the docs.
I changed the fill color to red and I also want to change the line color, but it stays blue
no matter what I do. I tried changing fill
, stroke
and color
to red
, but the line still stays blue
.
import altair as alt
from vega_datasets import data
source = data.stocks()
alt.Chart(source).mark_area(
color="red",
fill="red",
interpolate='step-after',
line=True
).encode(
x='date',
y='price'
).transform_filter(alt.datum.symbol == 'GOOG')
Am I missing something trivial?
Upvotes: 2
Views: 1452
Reputation: 86463
Setting color='red'
or stroke='red'
should work, but doesn't: this is probably a bug in Vega or Vega-Lite. But you can work around it by setting the color encoding to a value:
import altair as alt
from vega_datasets import data
source = data.stocks()
alt.Chart(source).mark_area(
fill="red",
interpolate='step-after',
line=True
).encode(
x='date',
y='price',
color=alt.value('red')
).transform_filter(alt.datum.symbol == 'GOOG')
Upvotes: 1