prawn-graph 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/prawn/graph/chart_components/line_chart_renderer.rb +9 -16
- data/lib/prawn/graph/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af7f2dacb03275d7904c31811e51ef3a8da4f632
|
4
|
+
data.tar.gz: 0f9c1e3d8d90e91bf8e5c642e9b478a61b003f5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e182b1dfc064ed83565aa2abbd0abc06341ad65d89f975b906ed904e76f0d95414ddd6e8c09d24e9ca9b1500c86f1548ea22461280f02c335a473f43db953065
|
7
|
+
data.tar.gz: fdb85146ae87527f54d8aa3672502b21df6487a86330f51494ac4eea6a0cae8f0a55963ff5fa137990fb9352937114d1ff411c355fa3cf0398886cb9b2c11ca6
|
data/README.md
CHANGED
@@ -8,11 +8,6 @@
|
|
8
8
|
[](https://hakiri.io/github/HHRy/prawn-graph/master)
|
9
9
|

|
10
10
|
|
11
|
-
**This readme reflects the state of _master_ which is not the released version of prawn-graph.**
|
12
|
-
|
13
|
-
**The code being used to cut gems for release is the `stable` Branch, please make pull requests for**
|
14
|
-
**bug fixes from that branch.**
|
15
|
-
|
16
11
|
An extension for the [prawn pdf library][5] which adds the ability to draw graphs (or charts if
|
17
12
|
you perfer) in PDF documents.
|
18
13
|
|
@@ -43,6 +38,12 @@ We build automatically using Travis CI. Our [.travis.yml][9] file targets the sa
|
|
43
38
|
Unlike previous versions of `prawn-graph`, this version does not at this time include a theme api or the
|
44
39
|
ability to change the colors used to render the graph.
|
45
40
|
|
41
|
+
### Removed deprecated methods
|
42
|
+
|
43
|
+
The `bar_chart`, `line_chart`, `bar_graph`, and `line_graph` methods have been removed. This means that this
|
44
|
+
version of prawn-graph is no-longer backwards compatible. If you _must_ use those old methods, then please
|
45
|
+
use version `0.9.10` and **upgrade your calls to prawn graph to use the new `graph` methods as soon as possible**.
|
46
|
+
|
46
47
|
## Installation
|
47
48
|
|
48
49
|
To use prawn-graph, you can add the following to your `Gemfile`:
|
@@ -13,21 +13,14 @@ module Prawn
|
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
-
def
|
17
|
-
if @series.
|
18
|
-
draw_marker_point(
|
19
|
-
|
16
|
+
def apply_marker_to_graph(value_marked, value, x, y, color)
|
17
|
+
if @series.mark_maximum? && value_marked == false && value != 0 && value == @series.max
|
18
|
+
draw_marker_point(color, x, y)
|
19
|
+
value_marked = true
|
20
20
|
end
|
21
|
-
|
21
|
+
value_marked
|
22
22
|
end
|
23
23
|
|
24
|
-
def mark_maximum_value(max_marked, value, x, y)
|
25
|
-
if @series.mark_maximum? && max_marked == false && value != 0 && value == @series.max
|
26
|
-
draw_marker_point(@canvas.theme.max, x, y)
|
27
|
-
max_marked = true
|
28
|
-
end
|
29
|
-
max_marked
|
30
|
-
end
|
31
24
|
|
32
25
|
def mark_average_line
|
33
26
|
if @series.mark_average?
|
@@ -73,10 +66,10 @@ module Prawn
|
|
73
66
|
prawn.fill_ellipse([ ( this_x_offset), this_y ], 1)
|
74
67
|
end
|
75
68
|
|
76
|
-
min_marked =
|
77
|
-
min_marked =
|
78
|
-
max_marked =
|
79
|
-
max_marked =
|
69
|
+
min_marked = apply_marker_to_graph(min_marked, previous_value, previous_x_offset, previous_y, @canvas.theme.min)
|
70
|
+
min_marked = apply_marker_to_graph(min_marked, this_value, this_x_offset, this_y, @canvas.theme.min)
|
71
|
+
max_marked = apply_marker_to_graph(max_marked, previous_value, previous_x_offset, previous_y, @canvas.theme.max)
|
72
|
+
max_marked = apply_marker_to_graph(max_marked, this_value, this_x_offset, this_y, @canvas.theme.max)
|
80
73
|
|
81
74
|
j += 1
|
82
75
|
end
|
data/lib/prawn/graph/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stenhouse
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-07-
|
12
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|