Skip to content

Instantly share code, notes, and snippets.

@mroswell
Last active October 17, 2017 20:45
Show Gist options
  • Save mroswell/b16346837eb26663b212b001af7f5e77 to your computer and use it in GitHub Desktop.
Save mroswell/b16346837eb26663b212b001af7f5e77 to your computer and use it in GitHub Desktop.
display month labels
date_chart1 = Chart(date_countsDF,
description='A linechart showing dates on x, and a count of turkey chemical residue tests on y'
).mark_line().encode(
X('CollectDate:T', timeUnit='yearmonth'),
Y('count:Q', aggregate='sum')
)
date_chart1.configure_cell(height=270, width=800)
# date_chart1.configure_axis(ticks=20)
-----------
date_chart = Chart(date_countsDF,
description='A linechart showing dates on x, and a count of turkey chemical residue tests on y'
).mark_line().encode(
x=X('CollectDate:T',
axis=Axis(labelAngle=320,labelBaseline="bottom",
labelAlign="right",
tickPadding=10,
ticks=40)),
y='count:Q'
)
date_chart.configure_cell(height=270, width=800)
# date_chart.configure_axis(ticks=40)
date_chart.configure(timeFormat="%b %Y",)
# date_chart.encode?
{
"data": {"url": "data/seattle-weather.csv"},
"mark": "bar",
"encoding": {
"x": {
"timeUnit": "month",
"field": "date",
"type": "ordinal"
},
"column": {
"field":"date",
"timeUnit":"year",
"type": "ordinal"
},
"y": {
"aggregate": "mean",
"field": "precipitation",
"type": "quantitative"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment