mirror of https://github.com/Kozea/pygal.git
Python to generate nice looking SVG graph
http://pygal.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
648 B
22 lines
648 B
import cssutils |
|
|
|
SVG = 'SVG 1.1' # http://www.w3.org/TR/SVG11/styling.html |
|
|
|
macros = { |
|
'paint': 'none|currentColor|{color}', |
|
'unitidentifier': 'em|ex|px|pt|pc|cm|mm|in|%', |
|
'length': '{positivenum}({unitidentifier})?', |
|
'dasharray': '{positivenum}(\s*,\s*{positivenum})*', |
|
} |
|
properties = { |
|
'stroke': '{paint}', |
|
'fill': '{paint}', |
|
'text-anchor': 'start|middle|end|inherit', |
|
'stroke-width': '{length}|inherit', |
|
'fill-opacity': '{num}|inherit', |
|
'stroke-dasharray': 'none|{dasharray}|inherit', |
|
} |
|
|
|
cssutils.profile.addProfile(SVG, properties, macros) |
|
|
|
cssutils.profile.defaultProfiles = [SVG, cssutils.profile.CSS_LEVEL_2] |