Dokuwiki Plugin: Format JpGraph

This is a plugin to use the PHP application JpGraph as a Dokuwiki plugin.

Graph Function

JpGraph Function Plotbigcup{a=1}{3}{delim{lbrace}{(x,{1/a}sin ax) : 0<=x<=2pi}{rbrace}}
 union delim{lbrace}{(x,sum{a=1}{3}{{1/a}sin ax}) : 0<=x<=2pi}{rbrace} 1)

JpGraph Function Plot ≡ {(cos θ,sin θ) : 0≤θ≤2π }

Graph Data Series

  • Put the plot type and other keywords after the last column.
    • LinePlot($yArray,[$xArray])
    • BarPlot($yArray,[$xArray])
    • ErrorPlot($yArray) [Two values for each x-value]
    • StockPlot($yArray) [Four values for each x-value: open,close,min,max]
    • BoxPlot($yArray) [Five values for each x-value: open,close,min,max,median]
    • ScatterPlot($yArray,$xArray)
    • FieldPlot($yArray,$xArray,$angleArray) [angle in degrees]
  • You can put the data table into a footnote of the graph.

Data in rows:

JpGraph Table Data Plot 2)

Data in columns:

JpGraph Table Data Plot3)

1) {(x,sin x) : 0≤x≤2π } ≡ delim{lbrace}{(x,sin x) : 0≤x≤2π }{rbrace}lbrace(x,sin x) : 0≤x≤2π rbrace Graph of a function
2)
Graph Title
Y-Axis Title (units)
X-Axis Title 1 2 3 4 5
Legend 1 0.1 0.2 0.3 0.4 0.5
Legend 2 0.5 0.4 0.3 0.5 0.6
Legend 3 1.5 1.4 1.3 1.5 1.6
3)
Graph Title
Y-Axis Title (units)
X-Axis TitleLegend 1Legend 2
1 0.5 .2
2 0.4 .3
3 .3 .4
4 .5 .5
5 .6 .6

Discussion

Steven Robertson, %2008/%04/%25 %08:%Apr:
Hi, I'm interested in finding out more about the Format JpGraph demonstrated here. So far I figured you're using the Format plugin and any help in getting that working with JpGraph would be appreciated. Could there be some more information available?
 
David Wagner, %2008/%04/%25 %16:%Apr:
Mr. Robertson, Thanks for your interest. As you surmised, I just installed JpGraph and the Dokuwiki Format plugin, and hacked at the latter until it worked. I followed the Format plugin examples, and read enough of the Dokuwiki docs to figure out how it parses the page source so I could pass the data into JpGraph function calls. I don't think more specific information will be very helpful since all three programs have probably been significantly revised since I cobbled together this little hack. If you look at the source of this page, you'll see how graph formatting codes are embedded at the end of table row lines; these characters are completely ignored by this version of Dokuwiki. To be honest, I don't really like how it is implemented right now, but probably won't change it until the need arises. It works fine for making a quick little graph online. As I recall, file and folder permissions were a pain to get set correctly (as usual), and finding the server path between Dokuwiki and JpGraph was a little tricky, but in the end was surprised at how few lines of code were needed to get the basic functionality shown here. Good Luck! ~David
 
Steven Robertson, %2008/%04/%28 %15:%Apr:
It's certainly a nice idea and this looks like an effective syntax. I never looked at the Format plugin before. This would make a nice plugin in it's own right. It doesn't sound like the Format plugin helps much here. A good charting plugin for DokuWiki would be useful. Now there's the Google graphing API that would be a good alternative and there's the Eastwood Chart Servlet project which emulates that using JFreeChart, if you don't think the Google solution is open enough. I think the JpGraph license discourages derivitive work so if I was spending time on doing this as something to share, I'd work with the Google API. Having said that, maybe someone is already writing one or interested in such a thing. What you've done is a neat hack and something like this in DokuWiki could be useful in scientific and engineering work.
 

Personal Tools