VegaLite Line Plot Question

The sort parameter expects an array:

julia> using VegaLite, DataFrames
julia> Summ_USCovid=DataFrame(:Month_Year => ["Apr 2020","May 2020","Apr 2021","May 2021"],:TotalCases => [100000.0,200000.0,400000,500000])
4×2 DataFrame
 Row │ Month_Year  TotalCases
     │ String      Float64
─────┼────────────────────────
   1 │ Apr 2020      100000.0
   2 │ May 2020      200000.0
   3 │ Apr 2021      400000.0
   4 │ May 2021      500000.0

julia> Summ_USCovid |> @vlplot(:line,x={:Month_Year,sort=["null"]},y=:TotalCases)

How did I found out?
The documentaion Sorting | Vega-Lite isn’t so helpfull in this case.
I don’t know if it is visible in a notebook (like in your screenshots) but when the VegaLite output is opened from a plain julia REPL just in a browser you can see “…” on top right:
image

There you can open the Vega Editor:

There the LOG is helping to find out what may be wrong.

1 Like