Skip to content

Commit

Permalink
Fix examples with invalid column data. Closes #81.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed Dec 1, 2016
1 parent da1e4cb commit c544e59
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.3.3
-----

* Fix examples that used invalid column data. (#81)
* lxml is no longer imported by default. (#83)
* Ordinal scales can now display data from multiple series with different values. (#76)
* Better error handling for data types supported by different shapes.
Expand Down
2 changes: 1 addition & 1 deletion examples/charts/colorized_dots.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/charts/mixed_shapes.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/charts/theme.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 8 additions & 16 deletions examples/mixed_shapes.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
import leather

column_data = [
('Hello', 3),
('How', 5),
('Are', 9),
('You', 4)
]

line_data = [
('Hello', 1),
('How', 5),
('Are', 4),
('You', 3)
(0, 1),
(2, 5),
(4, 4),
(8, 3)
]

dot_data = [
('Hello', 3),
('How', 5),
('Are', 9),
('You', 4)
(1, 3),
(2, 5),
(6, 9),
(10, 4)
]

chart = leather.Chart('Mixed shapes')
chart.add_columns(column_data)
chart.add_line(line_data)
chart.add_dots(dot_data)
chart.to_svg('examples/charts/mixed_shapes.svg')
26 changes: 9 additions & 17 deletions examples/theme.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
import leather

column_data = [
('Hello', 3),
('How', 5),
('Are', 9),
('You', 4)
]

line_data = [
('Hello', 1),
('How', 5),
('Are', 4),
('You', 3)
(0, 1),
(2, 5),
(4, 4),
(8, 3)
]

dot_data = [
('Hello', 3),
('How', 5),
('Are', 9),
('You', 4)
(1, 3),
(2, 5),
(6, 9),
(10, 4)
]

leather.theme.title_font_family = 'Comic Sans MS'
leather.theme.legend_font_family = 'Comic Sans MS'
leather.theme.tick_font_family = 'Comic Sans MS'
leather.theme.default_series_colors = ['#ff0000', '#00ff00', '#0000ff']
leather.theme.default_series_colors = ['#ff0000', '#00ff00']

chart = leather.Chart('Theme')
chart.add_columns(column_data)
chart.add_line(line_data)
chart.add_dots(dot_data)
chart.to_svg('examples/charts/theme.svg')

0 comments on commit c544e59

Please sign in to comment.