Help on Vega-Lite plot

I’m looking for help on why I cannot get this plot to work. The data are simple - date, values. Any help?
Here is link to my notebook which is quite small.

thanks, gani -

Hi @gganapat. I sent you a suggestion which fixes your issues. Click Merge to pull these changes into your notebook.

There were two issues:

  1. For inline data with Vega-Lite, you need to say data: {values: objects} rather than data: objects.

  2. Because Observable is reactive, you need to ensure your type coercion (convert) runs before you pass the data to Vega-Lite. Observable cells don’t run sequentially; they run in topological order based on references between cells. So the easiest way to ensure your data is coerced before you use it is to do inside the cell that calls d3.json.

Hi Mike, Thank you so much for this fast response! I’ll try it out.

gani -

1 Like

It works perfectly! Observable is fantastic.