graph_gnuplot_helper.xsl 2.3 KB

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