apexcharts 0.1.7 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +138 -71
  3. data/lib/apex_charts/charts.rb +17 -0
  4. data/lib/{apexcharts/charts/area.rb → apex_charts/charts/area_chart.rb} +1 -1
  5. data/lib/{apexcharts/charts/bar.rb → apex_charts/charts/bar_chart.rb} +1 -1
  6. data/lib/{apexcharts/charts/base.rb → apex_charts/charts/base_chart.rb} +6 -4
  7. data/lib/apex_charts/charts/box_plot_chart.rb +8 -0
  8. data/lib/{apexcharts/charts/bubble.rb → apex_charts/charts/bubble_chart.rb} +2 -2
  9. data/lib/{apexcharts/charts/candlestick.rb → apex_charts/charts/candlestick_chart.rb} +1 -1
  10. data/lib/{apexcharts/charts/cartesian.rb → apex_charts/charts/cartesian_chart.rb} +9 -9
  11. data/lib/{apexcharts/charts/column.rb → apex_charts/charts/column_chart.rb} +3 -1
  12. data/lib/{apexcharts/charts/donut.rb → apex_charts/charts/donut_chart.rb} +1 -1
  13. data/lib/{apexcharts → apex_charts}/charts/features/annotations.rb +7 -5
  14. data/lib/{apexcharts → apex_charts}/charts/features/mixable.rb +1 -1
  15. data/lib/{apexcharts/charts/heatmap.rb → apex_charts/charts/heatmap_chart.rb} +2 -2
  16. data/lib/{apexcharts/charts/line.rb → apex_charts/charts/line_chart.rb} +1 -1
  17. data/lib/{apexcharts/charts/mixed.rb → apex_charts/charts/mixed_charts.rb} +13 -7
  18. data/lib/{apexcharts/charts/pie.rb → apex_charts/charts/pie_chart.rb} +1 -1
  19. data/lib/apex_charts/charts/polar_chart.rb +9 -0
  20. data/lib/{apexcharts/charts/radar.rb → apex_charts/charts/radar_chart.rb} +2 -2
  21. data/lib/{apexcharts/charts/radial_bar.rb → apex_charts/charts/radial_bar_chart.rb} +1 -1
  22. data/lib/{apexcharts/charts/range_bar.rb → apex_charts/charts/range_bar_chart.rb} +1 -1
  23. data/lib/{apexcharts/charts/scatter.rb → apex_charts/charts/scatter_chart.rb} +1 -1
  24. data/lib/{apexcharts/charts/syncing.rb → apex_charts/charts/syncing_charts.rb} +2 -2
  25. data/lib/{apexcharts → apex_charts}/colors.rb +2 -1
  26. data/lib/apex_charts/config/default_options.rb +16 -0
  27. data/lib/apex_charts/config/schema.rb +20 -0
  28. data/lib/apex_charts/configuration.rb +27 -0
  29. data/lib/{apexcharts → apex_charts}/helper.rb +25 -24
  30. data/lib/apex_charts/options/default/annotations_options.rb +14 -0
  31. data/lib/apex_charts/options/default/chart_options.rb +33 -0
  32. data/lib/apex_charts/options/default/data_labels_options.rb +18 -0
  33. data/lib/apex_charts/options/default/fill_options.rb +14 -0
  34. data/lib/apex_charts/options/default/grid_options.rb +17 -0
  35. data/lib/apex_charts/options/default/helper_options.rb +22 -0
  36. data/lib/apex_charts/options/default/legend_options.rb +33 -0
  37. data/lib/apex_charts/options/default/markers_options.rb +26 -0
  38. data/lib/apex_charts/options/default/no_data_options.rb +14 -0
  39. data/lib/apex_charts/options/default/plot_options.rb +19 -0
  40. data/lib/apex_charts/options/default/root_options.rb +38 -0
  41. data/lib/apex_charts/options/default/states_options.rb +11 -0
  42. data/lib/apex_charts/options/default/stroke_options.rb +14 -0
  43. data/lib/apex_charts/options/default/theme_options.rb +11 -0
  44. data/lib/apex_charts/options/default/title_subtitle_options.rb +15 -0
  45. data/lib/apex_charts/options/default/tooltip_options.rb +25 -0
  46. data/lib/apex_charts/options/default/x_axis_options.rb +27 -0
  47. data/lib/apex_charts/options/default/y_axis_options.rb +28 -0
  48. data/lib/apex_charts/options/dry_schema/annotations_options.rb +22 -0
  49. data/lib/apex_charts/options/dry_schema/annotations_options/annotation_label.rb +24 -0
  50. data/lib/apex_charts/options/dry_schema/annotations_options/image_annotations.rb +15 -0
  51. data/lib/apex_charts/options/dry_schema/annotations_options/point_annotations.rb +33 -0
  52. data/lib/apex_charts/options/dry_schema/annotations_options/text_annotations.rb +26 -0
  53. data/lib/apex_charts/options/dry_schema/annotations_options/x_axis_annotations.rb +20 -0
  54. data/lib/apex_charts/options/dry_schema/annotations_options/y_axis_annotations.rb +21 -0
  55. data/lib/apex_charts/options/dry_schema/chart_options.rb +35 -0
  56. data/lib/apex_charts/options/dry_schema/data_labels_options.rb +37 -0
  57. data/lib/apex_charts/options/dry_schema/fill_options.rb +34 -0
  58. data/lib/apex_charts/options/dry_schema/general_schema/drop_shadow.rb +14 -0
  59. data/lib/apex_charts/options/dry_schema/general_schema/function.rb +12 -0
  60. data/lib/apex_charts/options/dry_schema/grid_options.rb +19 -0
  61. data/lib/apex_charts/options/dry_schema/helper_options.rb +22 -0
  62. data/lib/apex_charts/options/dry_schema/legend_options.rb +61 -0
  63. data/lib/apex_charts/options/dry_schema/markers_options.rb +34 -0
  64. data/lib/apex_charts/options/dry_schema/markers_options/discrete_point.rb +13 -0
  65. data/lib/apex_charts/options/dry_schema/no_data_options.rb +16 -0
  66. data/lib/apex_charts/options/dry_schema/plot_options.rb +231 -0
  67. data/lib/apex_charts/options/dry_schema/root_options.rb +42 -0
  68. data/lib/apex_charts/options/dry_schema/schema.rb +32 -0
  69. data/lib/apex_charts/options/dry_schema/states_options.rb +22 -0
  70. data/lib/apex_charts/options/dry_schema/states_options/filter.rb +10 -0
  71. data/lib/apex_charts/options/dry_schema/stroke_options.rb +21 -0
  72. data/lib/apex_charts/options/dry_schema/theme_options.rb +18 -0
  73. data/lib/apex_charts/options/dry_schema/title_subtitle_options.rb +22 -0
  74. data/lib/apex_charts/options/dry_schema/tooltip_options.rb +27 -0
  75. data/lib/apex_charts/options/dry_schema/x_axis_options.rb +30 -0
  76. data/lib/apex_charts/options/dry_schema/y_axis_options.rb +30 -0
  77. data/lib/{apexcharts → apex_charts}/options_builder.rb +63 -40
  78. data/lib/{apexcharts → apex_charts}/prefix_with_apex.rb +3 -1
  79. data/lib/{apexcharts → apex_charts}/prefixer.rb +2 -0
  80. data/lib/apex_charts/renderer.rb +113 -0
  81. data/lib/apex_charts/series.rb +7 -0
  82. data/lib/{apexcharts/series/bubble.rb → apex_charts/series/bubble_series.rb} +4 -2
  83. data/lib/{apexcharts/series/cartesian.rb → apex_charts/series/cartesian_series.rb} +4 -2
  84. data/lib/{apexcharts/series/polar.rb → apex_charts/series/polar_series.rb} +4 -2
  85. data/lib/{apexcharts → apex_charts}/support/rails.rb +0 -0
  86. data/lib/{apexcharts → apex_charts}/support/sinatra.rb +0 -0
  87. data/lib/{apexcharts → apex_charts}/theme.rb +2 -18
  88. data/lib/{apexcharts → apex_charts}/utils.rb +0 -0
  89. data/lib/{apexcharts → apex_charts}/utils/copy.rb +2 -0
  90. data/lib/{apexcharts → apex_charts}/utils/date_time.rb +7 -2
  91. data/lib/{apexcharts → apex_charts}/utils/hash.rb +2 -0
  92. data/lib/{apexcharts → apex_charts}/version.rb +2 -1
  93. data/lib/apexcharts.rb +3 -3
  94. data/vendor/assets/javascripts/apexcharts.js +11 -3
  95. metadata +103 -74
  96. data/lib/apexcharts/charts.rb +0 -13
  97. data/lib/apexcharts/charts/polar.rb +0 -7
  98. data/lib/apexcharts/config.rb +0 -25
  99. data/lib/apexcharts/config/default_options.rb +0 -12
  100. data/lib/apexcharts/options/annotations.rb +0 -10
  101. data/lib/apexcharts/options/axis.rb +0 -17
  102. data/lib/apexcharts/options/chart.rb +0 -26
  103. data/lib/apexcharts/options/data_labels.rb +0 -14
  104. data/lib/apexcharts/options/div_attributes.rb +0 -9
  105. data/lib/apexcharts/options/fill.rb +0 -12
  106. data/lib/apexcharts/options/grid.rb +0 -15
  107. data/lib/apexcharts/options/legend.rb +0 -27
  108. data/lib/apexcharts/options/markers.rb +0 -18
  109. data/lib/apexcharts/options/no_data.rb +0 -12
  110. data/lib/apexcharts/options/plot_options.rb +0 -12
  111. data/lib/apexcharts/options/root.rb +0 -44
  112. data/lib/apexcharts/options/states.rb +0 -9
  113. data/lib/apexcharts/options/stroke.rb +0 -12
  114. data/lib/apexcharts/options/subtitle.rb +0 -9
  115. data/lib/apexcharts/options/theme.rb +0 -8
  116. data/lib/apexcharts/options/title.rb +0 -13
  117. data/lib/apexcharts/options/tooltip.rb +0 -22
  118. data/lib/apexcharts/options/x_axis.rb +0 -12
  119. data/lib/apexcharts/options/y_axis.rb +0 -15
  120. data/lib/apexcharts/renderer.rb +0 -68
  121. data/lib/apexcharts/series.rb +0 -7
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class CandlestickChart < CartesianChart
5
5
  def chart_type
6
6
  'candlestick'
@@ -4,11 +4,11 @@ require_relative 'features/annotations'
4
4
  require_relative 'features/mixable'
5
5
  require_relative '../utils/hash'
6
6
 
7
- module ApexCharts
7
+ module ApexCharts::Charts
8
8
  class CartesianChart < BaseChart
9
- include Annotations
10
- include Mixable
11
- include Utils::Hash
9
+ include Features::Annotations
10
+ include Features::Mixable
11
+ include ApexCharts::Utils::Hash
12
12
 
13
13
  def initialize(outer_self, data, options={}, &block)
14
14
  @outer_self = outer_self
@@ -29,7 +29,7 @@ module ApexCharts
29
29
  end
30
30
 
31
31
  def series_type
32
- CartesianSeries
32
+ ApexCharts::Series::CartesianSeries
33
33
  end
34
34
 
35
35
  def more_options
@@ -37,7 +37,7 @@ module ApexCharts
37
37
  end
38
38
 
39
39
  def method_missing(method, *args, &block)
40
- if @outer_self.respond_to?(method)
40
+ if @outer_self.respond_to?(method, true)
41
41
  @outer_self.send method, *args, &block
42
42
  else
43
43
  super
@@ -45,7 +45,7 @@ module ApexCharts
45
45
  end
46
46
 
47
47
  def respond_to_missing?(method, *args)
48
- @outer_self.respond_to?(method) || super
48
+ @outer_self.respond_to?(method, true) || super
49
49
  end
50
50
 
51
51
  protected
@@ -57,7 +57,7 @@ module ApexCharts
57
57
  end
58
58
 
59
59
  def brush?
60
- @options[:chart][:brush]&.[](:enabled) && \
60
+ @options[:chart][:brush]&.[](:enabled) &&
61
61
  !@options[:chart][:selection]&.[](:xaxis)
62
62
  end
63
63
 
@@ -76,7 +76,7 @@ module ApexCharts
76
76
  end
77
77
 
78
78
  def handle_time(input)
79
- Utils::DateTime.convert(input)
79
+ ApexCharts::Utils::DateTime.convert(input)
80
80
  end
81
81
  end
82
82
  end
@@ -1,4 +1,6 @@
1
- module ApexCharts
1
+ # frozen_string_literal: true
2
+
3
+ module ApexCharts::Charts
2
4
  class ColumnChart < BarChart
3
5
  def more_options
4
6
  {plot_options: {bar: {horizontal: false}}}
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class DonutChart < PolarChart
5
5
  def chart_type
6
6
  'donut'
@@ -1,4 +1,6 @@
1
- module ApexCharts
1
+ # frozen_string_literal: true
2
+
3
+ module ApexCharts::Charts::Features
2
4
  module Annotations
3
5
  def annotation(axis, value:, text:, color: nil, **options)
4
6
  @annotations ||= {}
@@ -35,7 +37,7 @@ module ApexCharts
35
37
  axis = axis.to_s.delete_suffix('axis').to_sym
36
38
  case value
37
39
  when Range
38
- value = Utils::DateTime.convert_range(value)
40
+ value = ApexCharts::Utils::DateTime.convert_range(value)
39
41
 
40
42
  case axis
41
43
  when :x
@@ -47,10 +49,10 @@ module ApexCharts
47
49
  end
48
50
  else
49
51
  if axis == :points
50
- value.map! {|x| Utils::DateTime.convert(x) }
52
+ value.map! {|x| ApexCharts::Utils::DateTime.convert(x) }
51
53
  {x: value.first, y: value.last}
52
54
  else
53
- value = Utils::DateTime.convert(value)
55
+ value = ApexCharts::Utils::DateTime.convert(value)
54
56
  {axis => value}
55
57
  end
56
58
  end
@@ -69,6 +71,6 @@ module ApexCharts
69
71
  }
70
72
  end
71
73
 
72
- include Utils::Hash
74
+ include ApexCharts::Utils::Hash
73
75
  end
74
76
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts::Features
4
4
  module Mixable
5
5
  def mixed_series
6
6
  series[:series].each {|d| d.merge!(type: chart_type) }
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class HeatmapChart < BaseChart
5
5
  def chart_type
6
6
  'heatmap'
7
7
  end
8
8
 
9
9
  def series_type
10
- CartesianSeries
10
+ ApexCharts::Series::CartesianSeries
11
11
  end
12
12
  end
13
13
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class LineChart < CartesianChart
5
5
  def chart_type
6
6
  'line'
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ require_relative 'features/annotations'
4
+
5
+ module ApexCharts::Charts
4
6
  class MixedCharts < BaseChart
5
- include Annotations
6
- include Utils::Hash
7
+ include Features::Annotations
8
+ include ApexCharts::Utils::Hash
7
9
 
8
10
  def initialize(outer_self, options={}, &block)
9
11
  @outer_self = outer_self
@@ -19,6 +21,10 @@ module ApexCharts
19
21
  build_selection_range if brush?
20
22
  end
21
23
 
24
+ def chart_type
25
+ 'area' # chosen default
26
+ end
27
+
22
28
  def line_chart(data, options={}, &block)
23
29
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
24
30
  @series[:series] +=
@@ -50,7 +56,7 @@ module ApexCharts
50
56
  end
51
57
 
52
58
  def method_missing(method, *args, &block)
53
- if @outer_self.respond_to?(method)
59
+ if @outer_self.respond_to?(method, true)
54
60
  @outer_self.send method, *args, &block
55
61
  else
56
62
  super
@@ -58,7 +64,7 @@ module ApexCharts
58
64
  end
59
65
 
60
66
  def respond_to_missing?(method, *args)
61
- @outer_self.respond_to?(method) || super
67
+ @outer_self.respond_to?(method, true) || super
62
68
  end
63
69
 
64
70
  private
@@ -70,7 +76,7 @@ module ApexCharts
70
76
  end
71
77
 
72
78
  def brush?
73
- @options[:chart][:brush]&.[](:enabled) && \
79
+ @options[:chart][:brush]&.[](:enabled) &&
74
80
  !@options[:chart][:selection]&.[](:xaxis)
75
81
  end
76
82
 
@@ -89,7 +95,7 @@ module ApexCharts
89
95
  end
90
96
 
91
97
  def handle_time(input)
92
- Utils::DateTime.convert(input)
98
+ ApexCharts::Utils::DateTime.convert(input)
93
99
  end
94
100
  end
95
101
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class PieChart < PolarChart
5
5
  def chart_type
6
6
  'pie'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApexCharts::Charts
4
+ class PolarChart < BaseChart
5
+ def series_type
6
+ ApexCharts::Series::PolarSeries
7
+ end
8
+ end
9
+ end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class RadarChart < BaseChart
5
5
  def chart_type
6
6
  'radar'
7
7
  end
8
8
 
9
9
  def series_type
10
- CartesianSeries
10
+ ApexCharts::Series::CartesianSeries
11
11
  end
12
12
  end
13
13
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class RadialBarChart < PolarChart
5
5
  def chart_type
6
6
  'radialBar'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class RangeBarChart < BarChart
5
5
  def chart_type
6
6
  'rangeBar'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class ScatterChart < CartesianChart
5
5
  def chart_type
6
6
  'scatter'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ApexCharts
3
+ module ApexCharts::Charts
4
4
  class SyncingCharts
5
5
  def initialize(outer_self, options={}, &block)
6
6
  @outer_self = outer_self
@@ -62,7 +62,7 @@ module ApexCharts
62
62
  end
63
63
 
64
64
  def method_missing(method, *args, &block)
65
- if @outer_self.respond_to? method, *args
65
+ if @outer_self.respond_to?(method, true)
66
66
  @outer_self.send method, *args, &block
67
67
  else
68
68
  super
@@ -17,7 +17,8 @@ module ApexCharts
17
17
  def clean(colors)
18
18
  colors = colors.respond_to?(:to_set) ? colors.to_a.flatten : Array(colors)
19
19
  colors.map do |color|
20
- raise "unrecognized color #{color}" unless color.tap(&:upcase!)[/^#[0-9A-F]{6}/]
20
+ color = color.upcase
21
+ raise "unrecognized color #{color}" unless color[/^#[0-9A-F]{6}/]
21
22
 
22
23
  color
23
24
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApexCharts
4
+ module Config
5
+ module DefaultOptions
6
+ def default_options=(options)
7
+ @default_options =
8
+ ApexCharts::OptionsBuilder.new(nil, options).build_general_options
9
+ end
10
+
11
+ def default_options
12
+ @default_options ||= {}
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApexCharts
4
+ module Config
5
+ module Schema
6
+ def schema
7
+ @schema ||= 'Default'
8
+ end
9
+
10
+ def schema=(name)
11
+ @schema = case name
12
+ when :dry_schema, 'dry_schema', 'dry-schema'
13
+ 'DrySchema'
14
+ else
15
+ 'Default'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'config/default_options'
4
+ require_relative 'config/schema'
5
+
6
+ module ApexCharts
7
+ class << self
8
+ attr_writer :helper_prefix
9
+
10
+ def helper_prefix
11
+ @helper_prefix ||= ENV['APEXCHARTS_PREFIX']
12
+ end
13
+
14
+ def configure
15
+ block_given? ? yield(config) : config
16
+ end
17
+
18
+ def config
19
+ @config ||= Configuration.new
20
+ end
21
+ end
22
+
23
+ class Configuration
24
+ include ApexCharts::Config::DefaultOptions
25
+ include ApexCharts::Config::Schema
26
+ end
27
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'config'
3
+ require_relative 'configuration'
4
4
  require_relative 'utils'
5
5
  require_relative 'series'
6
6
  require_relative 'options_builder'
@@ -17,7 +17,7 @@ module ApexCharts
17
17
  def line_chart(series, options={}, &block)
18
18
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
19
19
  draw_chart(
20
- LineChart.new(
20
+ ApexCharts::Charts::LineChart.new(
21
21
  outer_self, *prepare_series_and_options(series, options), &block
22
22
  )
23
23
  )
@@ -26,7 +26,7 @@ module ApexCharts
26
26
  def area_chart(series, options={}, &block)
27
27
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
28
28
  draw_chart(
29
- AreaChart.new(
29
+ ApexCharts::Charts::AreaChart.new(
30
30
  outer_self, *prepare_series_and_options(series, options), &block
31
31
  )
32
32
  )
@@ -35,7 +35,7 @@ module ApexCharts
35
35
  def column_chart(series, options={}, &block)
36
36
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
37
37
  draw_chart(
38
- ColumnChart.new(
38
+ ApexCharts::Charts::ColumnChart.new(
39
39
  outer_self, *prepare_series_and_options(series, options), &block
40
40
  )
41
41
  )
@@ -44,7 +44,7 @@ module ApexCharts
44
44
  def bar_chart(series, options={}, &block)
45
45
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
46
46
  draw_chart(
47
- BarChart.new(
47
+ ApexCharts::Charts::BarChart.new(
48
48
  outer_self, *prepare_series_and_options(series, options), &block
49
49
  )
50
50
  )
@@ -53,7 +53,7 @@ module ApexCharts
53
53
  def range_bar_chart(series, options={}, &block)
54
54
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
55
55
  draw_chart(
56
- RangeBarChart.new(
56
+ ApexCharts::Charts::RangeBarChart.new(
57
57
  outer_self, *prepare_series_and_options(series, options), &block
58
58
  )
59
59
  )
@@ -62,7 +62,7 @@ module ApexCharts
62
62
  def scatter_chart(series, options={}, &block)
63
63
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
64
64
  draw_chart(
65
- ScatterChart.new(
65
+ ApexCharts::Charts::ScatterChart.new(
66
66
  outer_self, *prepare_series_and_options(series, options), &block
67
67
  )
68
68
  )
@@ -71,16 +71,25 @@ module ApexCharts
71
71
  def candlestick_chart(series, options={}, &block)
72
72
  outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
73
73
  draw_chart(
74
- CandlestickChart.new(
74
+ ApexCharts::Charts::CandlestickChart.new(
75
75
  outer_self, *prepare_series_and_options(series, options), &block
76
76
  )
77
77
  )
78
78
  end
79
79
  alias_method :ohlc_chart, :candlestick_chart
80
80
 
81
+ def box_plot_chart(series, options={}, &block)
82
+ outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
83
+ draw_chart(
84
+ ApexCharts::Charts::BoxPlotChart.new(
85
+ outer_self, *prepare_series_and_options(series, options), &block
86
+ )
87
+ )
88
+ end
89
+
81
90
  def heatmap_chart(series, options={})
82
91
  draw_chart(
83
- HeatmapChart.new(
92
+ ApexCharts::Charts::HeatmapChart.new(
84
93
  *prepare_series_and_options(series, options)
85
94
  )
86
95
  )
@@ -88,7 +97,7 @@ module ApexCharts
88
97
 
89
98
  def bubble_chart(series, options={})
90
99
  draw_chart(
91
- BubbleChart.new(
100
+ ApexCharts::Charts::BubbleChart.new(
92
101
  *prepare_series_and_options(series, options)
93
102
  )
94
103
  )
@@ -96,7 +105,7 @@ module ApexCharts
96
105
 
97
106
  def radar_chart(series, options={})
98
107
  draw_chart(
99
- RadarChart.new(
108
+ ApexCharts::Charts::RadarChart.new(
100
109
  *prepare_series_and_options(series, options)
101
110
  )
102
111
  )
@@ -105,7 +114,7 @@ module ApexCharts
105
114
  def mixed_charts(options={}, &block)
106
115
  outer_self = eval('self', block.binding, __FILE__, __LINE__)
107
116
  draw_chart(
108
- MixedCharts.new(
117
+ ApexCharts::Charts::MixedCharts.new(
109
118
  outer_self, deep_copy(options), &block
110
119
  )
111
120
  )
@@ -115,7 +124,7 @@ module ApexCharts
115
124
  def syncing_charts(options={}, &block)
116
125
  outer_self = eval('self', block.binding, __FILE__, __LINE__)
117
126
  draw_chart(
118
- SyncingCharts.new(
127
+ ApexCharts::Charts::SyncingCharts.new(
119
128
  outer_self, deep_copy(options), &block
120
129
  )
121
130
  )
@@ -124,7 +133,7 @@ module ApexCharts
124
133
 
125
134
  def pie_chart(series, options={})
126
135
  draw_chart(
127
- PieChart.new(
136
+ ApexCharts::Charts::PieChart.new(
128
137
  *prepare_series_and_options(series, options)
129
138
  )
130
139
  )
@@ -132,7 +141,7 @@ module ApexCharts
132
141
 
133
142
  def donut_chart(series, options={})
134
143
  draw_chart(
135
- DonutChart.new(
144
+ ApexCharts::Charts::DonutChart.new(
136
145
  *prepare_series_and_options(series, options)
137
146
  )
138
147
  )
@@ -140,7 +149,7 @@ module ApexCharts
140
149
 
141
150
  def radial_bar_chart(series, options={})
142
151
  draw_chart(
143
- RadialBarChart.new(
152
+ ApexCharts::Charts::RadialBarChart.new(
144
153
  *prepare_series_and_options(series, options)
145
154
  )
146
155
  )
@@ -148,14 +157,6 @@ module ApexCharts
148
157
  alias_method :circle_chart, :radial_bar_chart
149
158
  end
150
159
 
151
- def create_palette(palette_name, colors)
152
- Theme::Local.create palette_name, colors
153
- end
154
-
155
- def destroy_palette(palette_name)
156
- Theme::Local.destroy palette_name
157
- end
158
-
159
160
  private
160
161
 
161
162
  def draw_chart(chart)