| 1 | {% extends "basex.html" %} |
| 2 | {% load markup %} |
| 3 | {% block pageid %}code{% endblock %} |
| 4 | {% block headers %} |
| 5 | <link href="doc.css" media="screen" rel="stylesheet" type="text/css" /> |
| 6 | {% endblock %} |
| 7 | {% block title %}PlotKit.SVG{% endblock %} |
| 8 | |
| 9 | {% block content %} |
| 10 | <div class="page doc api"> |
| 11 | {% filter markdown %} |
| 12 | [PlotKit Home](PlotKit.html) | [<<](PlotKit.Canvas.html) | [>>](PlotKit.SweetCanvas.html) |
| 13 | |
| 14 | PlotKit SVG |
| 15 | =========== |
| 16 | |
| 17 | PlotKit SVG includes the SVGRenderer which allows chart plotting on SVG capable browsers such as Firefox 1.5 and Opera 9.0. It should support Adobe SVG plugin, but is current untested. |
| 18 | |
| 19 | Important Implementation Requirements |
| 20 | ------------------------------------- |
| 21 | |
| 22 | In order to use the SVG Renderer, the file and webserver must support inline SVG files. This means the following conditions must exist: |
| 23 | |
| 24 | ###The HTML file must be XHTML compliant. |
| 25 | |
| 26 | So it should start off with this: |
| 27 | |
| 28 | <?xml version="1.0" encoding="UTF-8"?> |
| 29 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 30 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 31 | <html |
| 32 | xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" |
| 33 | xmlns:svg="http://www.w3.org/2000/svg" |
| 34 | xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 35 | <head> |
| 36 | <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2" width="1" height="1"></object> |
| 37 | <?import namespace="svg" implementation="#AdobeSVG"?> |
| 38 | ... |
| 39 | |
| 40 | ###Correct XHTML Mime-Type |
| 41 | |
| 42 | Firefox and MSIE are fussy about the mimetype to do in-line |
| 43 | SVG. Firefox requires that either the URL ends in .html or that the |
| 44 | file is returned as mime type ``application/xhtml+xml`` in the HTTP |
| 45 | headers. |
| 46 | |
| 47 | However, MSIE does not recognise ``application/xhtml+xml`` and will |
| 48 | work fine with regular ``text/html`` mimetype for XHTML. |
| 49 | |
| 50 | ###Non XHTML Compliant javascript includes |
| 51 | |
| 52 | You cannot use the autoloading MochiKit.js, but instead include all the JS files individually or use the packed MochiKit. This is because MochiKit's way of autoloading is not XHTML compliant. |
| 53 | |
| 54 | An example of this is in the tests. |
| 55 | |
| 56 | |
| 57 | PlotKit SVG Options |
| 58 | ------------------- |
| 59 | |
| 60 | There are no additional options for the SVG Renderer apart from the default Renderer options. |
| 61 | |
| 62 | {% endfilter %} |
| 63 | </div> |
| 64 | {% endblock %} |