I am trying to create a bar chart with year data on x-axis. It works but the year marker on x-xais are all in vertical direction and I want to make them more readable - either horizontal or 45 degree. I tried using the year:T
in datatime format but it gave me the year and month markers (I just wanted to have the year markers on xais). How do I make the year markers on x-axis either horizontal or 45 degree?
import altair as alt
from vega_datasets import data
source = data.wheat()
source.info()
abars = alt.Chart(source).mark_bar().encode(
x='year:O',
y="wheat:Q"
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.