Sha256: a8de51b224ef3261ac7a3f521b18a06102804fb0adbcf8d70adaa32ce98f00df

Contents?: true

Size: 943 Bytes

Versions: 10

Compression:

Stored size: 943 Bytes

Contents

module Echarts
  module Binary
    def self.get_config(value, title, subtitle, yLabel)
      {
        grid: {
          top: 80,
        },
        title: {
          text: title,
          subtext: subtitle,
        },
        toolbox: {
          top: 'middle',
          right: 5,
          orient: "vertical",
          feature: {
            saveAsImage: {},
          },
        },
        tooltip: {
          trigger: "axis",
        },
        series: [
          {
            name: 'Alert',
            type: 'pie',
            radius: '50%',
            data: [
              { value: value, name: yLabel, itemStyle: { color: value == 0 ? 'limegreen' : 'tomato' } },
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            },
          },
        ],
      }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
thecore_ui_commons-3.2.19 lib/echarts/binary.rb
thecore_ui_commons-3.2.18 lib/echarts/binary.rb
thecore_ui_commons-3.2.17 lib/echarts/binary.rb
thecore_ui_commons-3.2.16 lib/echarts/binary.rb
thecore_ui_commons-3.2.15 lib/echarts/binary.rb
thecore_ui_commons-3.2.14 lib/echarts/binary.rb
thecore_ui_commons-3.2.13 lib/echarts/binary.rb
thecore_ui_commons-3.2.12 lib/echarts/binary.rb
thecore_ui_commons-3.2.11 lib/echarts/binary.rb
thecore_ui_commons-3.2.10 lib/echarts/binary.rb