From 5b16a10b26548a1f267d05cd59334c1b0ad092c1 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Fri, 8 Jun 2018 22:25:30 -0700 Subject: [PATCH] Add another plot to docs --- .../examples_area_Charts_streamgraphs.md | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/docs/src/examples/examples_area_Charts_streamgraphs.md b/docs/src/examples/examples_area_Charts_streamgraphs.md index c39044dd..c32c42c7 100644 --- a/docs/src/examples/examples_area_Charts_streamgraphs.md +++ b/docs/src/examples/examples_area_Charts_streamgraphs.md @@ -118,4 +118,39 @@ dataset("unemployment-across-industries") |> ## Horizon Graph -TODO +```@example +using VegaLite, DataFrames + +data = DataFrame( + x=1:20, + y=[28,55,43,91,81,53,19,87,52,48,24,49,87,66,17,27,68,16,49,15] +) + +data |> +@vlplot(width=300, height=50, config={area={interpolate=:monotone}}) + +@vlplot( + mark={ + :area, + clip=true, + orient=:vertical + }, + x={:x, scale={zero=false, nice=false}}, + y={:y, scale={domain=[0,50]}}, + opacity={value=0.6} +) + +@vlplot( + transform=[{calculate="datum.y-50", as=:ny}], + mark={ + :area, + clip=true, + orient=:vertical + }, + x=:x, + y={ + "ny:q", + scale={domain=[0,50]}, + axis={title="y"} + }, + opacity={value=0.3} +) +```