Sha256: 2d21a70b42972254cf526d9bbb4bd92c52bb081169512aeb0a940f778d154efe

Contents?: true

Size: 894 Bytes

Versions: 28

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbLineGraph
    class LineGraph
      include Playbook::Props

      partial "pb_line_graph/line_graph"

      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

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

      def chart_options
        {
          id: id,
          chartData: chart_data,
          type: chart_type,
          title: title,
          subTitle: subtitle,
          axisTitle: axis_title,
          pointStart: point_start,
        }.to_json.html_safe
      end

      def classname
        generate_classname("pb_line_graph")
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
playbook_ui-4.7.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.7.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.6.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.6.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.5.2 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.5.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.5.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.4.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.4.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.3.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.3.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.2.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.1.2 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.1.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.1.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.0.1 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-4.0.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-3.5.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-3.4.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb
playbook_ui-3.3.0 app/pb_kits/playbook/pb_line_graph/line_graph.rb