Skip to content

Commit aee700b

Browse files
committed
Implement Line
1 parent fe88713 commit aee700b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/nyaplot/charts/line.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module Nyaplot
2+
module Charts
3+
class Line < ChartBase
4+
allow :all, :all
5+
need :data, :x, :y, :position
6+
7+
def create(**opts)
8+
data = opts[:data]
9+
data_l = ad Layers::Data.new({data: data})
10+
11+
args = {
12+
data: data_l,
13+
x: opts[:x],
14+
y: opts[:y],
15+
position: opts[:position]
16+
}
17+
18+
ag Layers::Line.new(args)
19+
20+
@xdomain = [data[opts[:x]].min, data[opts[:x]].max]
21+
@ydomain = [data[opts[:y]].min, data[opts[:y]].max]
22+
end
23+
end
24+
end
25+
end

0 commit comments

Comments
 (0)