Personal tools
You are here: Home Range CGI SVG
Document Actions

SVG

by Perry Kundert last modified 2007-08-29 13:05

SVG Experimentation.

Enabling "sparkline" graphs in Plone with <iframe>

By default, the <embed> and <object> tags are deemed "unsafe" by Plone, and are stripped by the Safe HTML transformation.  The <iframe> tag is simply not included in the list of Safe HTML tags, and it is also stripped.  I've added it in (see your Plone site's management console, and go to the 'portal_transformations' page).


A Simple SVG Graph.

<object data="http://kundert.ca/sparc?legend=bottom&Magenta=magenta:1,2,4,9,1,5&Cyan=cyan:1,2,3,4,3,2,1&Rouge=red:10,9,1,8,5&line=1&height=20&min=red&max=green&width=200&style=smooth" type="image/svg+xml" name="graph1" height="40" width="250"> A Simple SVG Graph. </object>


A Simple SVG Graph.

<embed data="http://kundert.ca/sparc?legend=bottom&Magenta=magenta:1,2,4,9,1,5&Cyan=cyan:1,2,3,4,3,2,1&Rouge=red:10,9,1,8,5&line=1&height=20&min=red&max=green&width=200&style=smooth" type="image/svg+xml" name="graph1" height="40" width="250"> A Simple SVG Graph. </embed>


<iframe src="http://kundert.ca/sparc?legend=bottom&Magenta=magenta:1,2,4,9,1,5&Cyan=cyan:1,2,3,4,3,2,1&Rouge=red:10,9,1,8,5&line=1&height=20&min=red&max=green&width=200&style=smooth" height="40" width="250"> A Simple SVG Graph. </iframe>

graph1 A Simple SVG Graph.

Embedding "sparkline" graphs in Plone with <img>

Well, SVG isn't supported by most browsers using the <img ...> tag, but other formats are:

<img src="http://kundert.ca/sparc?legend=bottom&Magenta=magenta:1,2,4,9,1,5&Cyan=cyan:1,2,3,4,3,2,1&Rouge=red:10,9,1,8,5&line=1&height=20&min=red&max=green&width=200&style=smooth" alt="graph1" /> A Simple SVG Graph.

graph1 A Simple SVG Graph.

<img src="http://kundert.ca/sparc?format=svg&legend=bottom&Magenta=magenta:1,2,4,9,1,5&Cyan=cyan:1,2,3,4,3,2,1&Rouge=red:10,9,1,8,5&line=1&height=20&min=red&max=green&width=200&style=smooth" alt="graph1" /> A Simple SVG Graph.

graph1 A Simple PNG Graph.

<img src="http://kundert.ca/sparc?format=png&legend=bottom&Magenta=magenta:1,2,4,9,1,5&Cyan=cyan:1,2,3,4,3,2,1&Rouge=red:10,9,1,8,5&line=1&height=20&min=red&max=green&width=200&style=smooth" alt="graph1" /> A Simple PNG Graph.


Site by Sunflower Graphics
Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: