Simple Bar Chart Example

Source code can be found on Github

Category 1Category 2Category 3Category 4Category 5Category 6Category 7Category 8Category 9Category 10025507510012515017520022525031100983110098414455414455418546418546158652158652332413332413997415997415448148448148261090261090274552274552117642117642

Click a bar. Any bar

Code


options = [
  mapping: %{category_col: "Category", value_cols: ["Series 1", "Series 2", "Series 3"]},
  type: :stacked,
  data_labels: true,
  orientation: :vertical,
  phx_event_handler: "chart1_bar_clicked",
  colour_palette: ["ff9838", "fdae53", "fbc26f", "fad48e", "fbe5af", "fff5d1"],
  select_item: ,
  
]

plot = Plot.new(test_data, BarChart, 500, 400, options)
  |> Plot.titles("", "")
  |> Plot.axis_labels("", "")
  |> Plot.plot_options(%{})