Skip to content

Commit

Permalink
Fix #336
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Sep 5, 2016
1 parent 67ff494 commit 0191d45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions docs/documentation/custom_styles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ NB: Now the css rules are prefixed by an unique id, to prevent collisions when i
with open(custom_css_file, 'w') as f:
f.write(custom_css)
config = pygal.Config(fill=True, interpolate='cubic')
config.css.append(custom_css_file)
config.css.append('file://' + custom_css_file)
chart = pygal.StackedLine(config)
chart.add('A', [1, 3, 5, 16, 13, 3, 7])
chart.add('B', [5, 2, 3, 2, 5, 7, 17])
chart.add('C', [6, 10, 9, 7, 3, 1, 0])
chart.add('D', [2, 3, 5, 9, 12, 9, 5])
chart.add('E', [7, 4, 2, 1, 2, 10, 0])


4 changes: 3 additions & 1 deletion pygal/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ def add_styles(self):
if css.startswith('inline:'):
css_text = css[len('inline:'):]
elif css.startswith('file://'):
css = css[len('file://'):]

if not os.path.exists(css):
css = os.path.join(
os.path.dirname(__file__), 'css', css[len('file://'):])
os.path.dirname(__file__), 'css', css)

with io.open(css, encoding='utf-8') as f:
css_text = template(
Expand Down

0 comments on commit 0191d45

Please sign in to comment.