class Playbook::PbBarGraph::BarGraph

def chart_options

def chart_options
  {
    id: id,
    className: classname,
    chartData: chart_data,
    dark: dark ? "dark" : "",
    type: chart_type,
    title: title,
    subtitle: subtitle,
    axisTitle: axis_title,
    pointStart: point_start,
    xAxisCategories: x_axis_categories,
    yAxisMin: y_axis_min,
    yAxisMax: y_axis_max,
    legend: legend,
    toggleLegendClick: toggle_legend_click,
    height: height,
    colors: colors,
  }
end

def chart_type

def chart_type
  orientation == "horizontal" ? "bar" : "column"
end

def classname

def classname
  generate_classname("pb_bar_graph")
end