charma 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ foobar = SampleMaker.new(20000)
20
20
 
21
21
  small = SampleMaker.new(6)
22
22
 
23
- Charma::Document.new{ |doc|
23
+ Charma::Document.new do |doc|
24
24
  [
25
25
  {
26
26
  title: "Lorem ipsum",
@@ -62,4 +62,5 @@ Charma::Document.new{ |doc|
62
62
  end
63
63
  end
64
64
  end
65
- }.render( File.basename(__FILE__, ".*")+".pdf" )
65
+ doc.render( File.basename(__FILE__, ".*")+".pdf" )
66
+ end
@@ -47,7 +47,6 @@ module Charma
47
47
  end
48
48
 
49
49
  def render( pdf, rect )
50
- stroke_rect(pdf, rect)
51
50
  title_text = @opts[:title]
52
51
  title, main, ticks, bottom = rect.vsplit(
53
52
  (title_text ? 1 : 0),
@@ -104,7 +104,6 @@ module Charma
104
104
  end
105
105
 
106
106
  def render( pdf, rect )
107
- stroke_rect(pdf, rect)
108
107
  title_text = @opts[:title]
109
108
  title, main, ticks, bottom = rect.vsplit(
110
109
  (title_text ? 1 : 0),
@@ -127,15 +126,6 @@ module Charma
127
126
  yvalues = tick_values(:y, yrange)
128
127
  render_yticks(pdf, yticks, yrange, yvalues)
129
128
  render_y_grid(pdf, chart, yrange, yvalues)
130
-
131
- # end
132
- # if @opts[:x_ticks]
133
- # _, _, xticks = ticks.hsplit(*hratio)
134
- # render_xticks(pdf, xticks)
135
- # end
136
- # yvalues = ytick_values(yrange)
137
- # render_yticks(pdf, yticks, yrange, yvalues)
138
- # render_y_grid(pdf, chart, yrange, yvalues)
139
129
  end
140
130
  end
141
131
  end
@@ -37,7 +37,6 @@ module Charma
37
37
  end
38
38
 
39
39
  def render(pdf)
40
- pdf.stroke_axis
41
40
  @graphs.each.with_index do |g,ix|
42
41
  g.render( pdf, area(pdf.margin_box, ix) )
43
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Charma
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -78,6 +78,7 @@ module Charma
78
78
  end
79
79
 
80
80
  def render_chart(pdf, rect, yrange)
81
+ stroke_rect(pdf, rect)
81
82
  y_values = @opts[:series].map{ |s| s[:y] }.transpose
82
83
  bar_areas = rect.hsplit(*Array.new(y_values.size,1))
83
84
  cols = if y_values.first.size==1
@@ -93,7 +94,6 @@ module Charma
93
94
 
94
95
  # BarChart の render とほぼ同じなのでなんとかする
95
96
  def render( pdf, rect )
96
- stroke_rect(pdf, rect)
97
97
  title_text = @opts[:title]
98
98
  title, main, ticks, bottom = rect.vsplit(
99
99
  (title_text ? 1 : 0),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nabetani
@@ -105,6 +105,8 @@ files:
105
105
  - examples/line_charts.pdf
106
106
  - examples/line_charts.rb
107
107
  - examples/runall.rb
108
+ - examples/shortest.pdf
109
+ - examples/shortest.rb
108
110
  - examples/violin_charts.pdf
109
111
  - examples/violin_charts.rb
110
112
  - lib/charma.rb