Browse Source

Began work on fine-grained CSS support.

pull/8/head
jaraco 17 years ago
parent
commit
75a07dd565
  1. 7
      lib/SVG/__init__.py
  2. 1
      setup.py

7
lib/SVG/__init__.py

@ -6,6 +6,7 @@ __all__ = ('Plot', 'TimeSeries', 'Bar', 'Pie', 'Schedule')
from xml.dom import minidom as dom
from operator import itemgetter
from itertools import islice
from cssutils import css, stylesheets
try:
import zlib
@ -651,6 +652,12 @@ Copyright © 2008 Jason R. Coombs
self.graph_height = self.height - self.border_top - self.border_bottom
def get_style(self):
sheet = css.CSSStyleSheet()
master_bg_style = css.CSSStyleDeclaration()
master_bg_style.setProperty('fill', '#ffffff')
rule = css.CSSStyleRule(selectorText=u'.svgBackground', style=master_bg_style)
sheet.insertRule(rule)
result = sheet.cssText
result = """/* Copy from here for external style sheet */
.svgBackground{
fill:#ffffff;

1
setup.py

@ -16,6 +16,7 @@ setup(name = "svg-chart",
package_dir = {'':'lib'},
install_requires=[
'python-dateutil>=1.4',
'cssutils>=0.9.4',
],
license = "MIT",
long_description = """\

Loading…
Cancel
Save