Skip to content

Commit

Permalink
Never use px.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed May 19, 2016
1 parent af9574e commit fac3a01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/example.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 leather/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def to_svg(self, width, height, scale, orient):
y2=six.text_type(y2),
stroke=tick_color
)
tick.set('stroke-width', theme.tick_width)
tick.set('stroke-width', six.text_type(theme.tick_width))

if orient == 'left':
x = label_x
Expand Down
8 changes: 4 additions & 4 deletions leather/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def to_svg_group(self, width, height, margin=None):
fill=theme.title_color
)
label.set('font-family', theme.title_font_family)
label.set('font-size', theme.title_font_size)
label.set('font-size', six.text_type(theme.title_font_size))
label.text = six.text_type(self._title)

header_group.append(label)
Expand Down Expand Up @@ -221,9 +221,9 @@ def to_svg(self, path, width=600, height=600, margin=None):
"""
Render this chart to an SVG document.
Technically, :code:`width` and :code:`height` are specified in SVG
"unitless" units, however, because font sizes resolve to pixels, it is
usually best to think of these as pixels.
Note: :code:`width` and :code:`height` are specified in SVG's
"unitless" units, however, it is usually convenient to specify them
as though they were pixels.
:param path:
Filepath or file-like object to write to.
Expand Down
6 changes: 3 additions & 3 deletions leather/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
# Chart title
title_color = '#333'
title_font_family = 'Monaco'
title_font_size = '16px'
title_font_size = 16
title_font_char_height = 20
title_font_char_width = 9

# Tick lines
tick_width = '1px'
tick_width = 1
tick_size = 4
tick_color = '#eee'
label_color = '#9c9c9c'
zero_color = '#a8a8a8'

# Tick labels
tick_font_family = 'Monaco'
tick_font_size = '14px'
tick_font_size = 14
tick_font_char_height = 14
tick_font_char_width = 8

Expand Down

0 comments on commit fac3a01

Please sign in to comment.