Simple Bar Chart Example

Source code can be found on Github

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

Click a bar. Any bar

Code

plot_content = BarChart.new(test_data)
  |> BarChart.set_val_col_names(["Series 1", "Series 2", "Series 3"])
  |> BarChart.type(:stacked)
  |> BarChart.data_labels(true)
  |> BarChart.orientation(:vertical)
  |> BarChart.event_handler("chart1_bar_clicked")
  |> BarChart.colours(["ff9838", "fdae53", "fbc26f", "fad48e", "fbe5af", "fff5d1"])
  

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