Sha256: c0c47472b07674f0de5b05df439b48b6e515db900fb38607ead427370b498426

Contents?: true

Size: 1.6 KB

Versions: 74

Compression:

Stored size: 1.6 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbLineGraph
    class LineGraph < Playbook::KitBase
      prop :axis_title
      prop :chart_data, type: Playbook::Props::Array,
                        default: []
      prop :gradient, type: Playbook::Props::Boolean,
                      default: false
      prop :point_start, type: Playbook::Props::Numeric
      prop :subtitle
      prop :title
      prop :x_axis_categories, type: Playbook::Props::Array,
                               default: []
      prop :y_axis_min, type: Playbook::Props::Numeric
      prop :y_axis_max, type: Playbook::Props::Numeric
      prop :legend, type: Playbook::Props::Boolean,
                    default: false
      prop :toggle_legend_click, type: Playbook::Props::Boolean,
                                 default: true
      prop :height
      prop :colors, type: Playbook::Props::Array,
                    default: []

      def chart_type
        gradient ? "area" : "line"
      end

      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 classname
        generate_classname("pb_line_graph")
      end
    end
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
playbook_ui-11.11.0.pre.alpha.paginate2 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.11.0.pre.alpha.dialog2 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.11.0.pre.alpha.paginate1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.11.0.pre.alpha.renderer1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.11.0.pre.alpha.dialog1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.11.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.10.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.9.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.8.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.8.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.7.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.6.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.5.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.7.0.pre.alpha.pre.guagechart1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.6.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-11.5.0.pre.alpha.datepicker1 app/pb_kits/playbook/pb_line_graph/line_graph.rb