graph_gnuplot_helper.xsl 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  6. exclude-result-prefixes="xs"
  7. version="2.0">
  8. <xsl:param name="uuid" required="yes"/>
  9. <xsl:param name="population.dat" required="yes"/>
  10. <xsl:param name="barchart.gnuplot" required="yes"/>
  11. <xsl:param name="barchart.png" required="yes"/>
  12. <xsl:param name="dstfile" required="yes"/>
  13. <xsl:param name="ditadir" required="yes"/>
  14. <!-- example input xml
  15. $graph_to_image.example
  16. -->
  17. <!-- example output fileindex
  18. <graph x="1" y="1">
  19. <title>some title</title>
  20. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/graph_gnuplot/temp/graph_to_image/{$uuid}/image-1-1.png</file>
  21. </graph>
  22. -->
  23. <xsl:variable name="graph_to_image.example">
  24. <system_cache__appinfo:graph_to_image.population.dat>
  25. <population.dat rowname="Adelaide">1.277174</population.dat>
  26. <population.dat rowname="Canberra">Canberra</population.dat>
  27. <population.dat rowname="Canberra">0.374658</population.dat>
  28. </system_cache__appinfo:graph_to_image.population.dat>
  29. </xsl:variable>
  30. <!-- example from web http://timmurphy.org/2014/08/11/creating-bar-charts-with-gnuplot/
  31. plot <data_file> using <label_column>:xtic(<value_column>) with boxes
  32. barchart.gnuplot:
  33. set terminal pngcairo font "arial,10" size 500,500
  34. set output 'barchart.png'
  35. set boxwidth 0.75
  36. set style fill solid
  37. set title "Population of Australian cities (millions), as of June 2012"
  38. plot "population.dat" using 2:xtic(1) with boxes
  39. population.dat
  40. Adelaide 1.277174
  41. Brisbane 2.189878
  42. Canberra 0.374658
  43. Darwin 0.131678
  44. Hobart 0.216959
  45. Melbourne 4.246345
  46. Sydney 4.667283
  47. -->
  48. <xsl:template match="system_cache__appinfo:graph_to_image.population.dat">
  49. </xsl:template>
  50. </xsl:stylesheet>