Template:SVG Chart/doc/programming

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Modify the source code[edit]

If you mean that something should be changed, the easiest way is:

  1. Check the produced svg file regarding the wanted feature.
  2. Note respectively copy the id attribute name of that relevant text area.
  3. Search that id name in the template source.
  4. Modify this founded template source accordingly.

File structure[edit]

The core function is SVG_Chart/Core. The supplementary functions are listed here.

Workarounds for librsvg[edit]

Workarounds are required because the librsvg (current version 2.36.1) renderer of Mediawiki does not have all functions implemented or produce incorrect images.

Non-scaling-stroke[edit]

The line thickness will be changed in only one direction by use of the stretching values GraphStretchWidth and GraphStretchHeight. This could be prevented by use of the instruction vector-effect="non-scaling-stroke". But this does not work in librsvg. Depending on the required line thickness therefore up to three or five lines are shown overlapped. The realisation you can see in GraphUseLines.

Misplaced text[edit]

Text with a small font size is moved to a wrong position. One task which helps, is to beginning with a rect command. The second strategy is to move the text with a special tspan command, see besides the TextDY TextDY function.

Specifics for Internet Explorer[edit]

Copied text which have coded with word wrap <br /> don't have the word wrap in the .svg file. I don't know a solution.