From 504596c42dfc1e23a433cf905f41235e03f7867f Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Wed, 27 Nov 2024 15:06:44 +0000 Subject: [PATCH] Add chart for Count by Artist --- music_library.livemd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/music_library.livemd b/music_library.livemd index 6d94f76a..6fd1b9e8 100644 --- a/music_library.livemd +++ b/music_library.livemd @@ -41,6 +41,16 @@ count_by_artist = ) ``` + + +```elixir +VegaLite.new(width: 600, title: "Count by Artist") +|> VegaLite.data_from_values(count_by_artist, only: ["c", "name"]) +|> VegaLite.mark(:bar) +|> VegaLite.encode_field(:x, "c", type: :quantitative) +|> VegaLite.encode_field(:y, "name", type: :nominal) +``` + ### Count of records by genre