Sha256: 4827b1ac0738bdbcf4f314cb8a5246e6d07869e6e0388a008cc8c5dd7cea4276

Contents?: true

Size: 644 Bytes

Versions: 12

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

panel do
  title 'Questionnaire With Chart'

  question :v_1, type: :string do
    title 'Title 1'
  end

  question :v_2, type: :string do
    title 'Title 2'
  end

  question :v_3, type: :string do
    title 'Title 3'
  end
end

score :total, :label => 'Total', schema: [{key: :value, export_key: :tot, label: 'Score'}] do
  {value: sum(values('v_1', 'v_2', 'v_3')) / 3.0}
end

overview_chart do
  subscore :value
  y_max 100
end

line_chart :tot do
  range 0..100
  plot :total
  plot :v_1, label: 'Label 1'
  plot :v_2
  plot :v_3
  plotband 30, 50, :yellow
  plotband 50, 80, :red
  plotline 20, :green
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
quby-5.4.0 spec/fixtures/questionnaire_with_chart.rb
quby-5.3.1 spec/fixtures/questionnaire_with_chart.rb
quby-5.3.0 spec/fixtures/questionnaire_with_chart.rb
quby-5.2.0 spec/fixtures/questionnaire_with_chart.rb
quby-5.1.3 spec/fixtures/questionnaire_with_chart.rb
quby-5.1.2 spec/fixtures/questionnaire_with_chart.rb
quby-5.1.1 spec/fixtures/questionnaire_with_chart.rb
quby-5.1.0 spec/fixtures/questionnaire_with_chart.rb
quby-5.0.5 spec/fixtures/questionnaire_with_chart.rb
quby-5.0.4 spec/fixtures/questionnaire_with_chart.rb
quby-5.0.3 spec/fixtures/questionnaire_with_chart.rb
quby-5.0.2 spec/fixtures/questionnaire_with_chart.rb