Thread:User talk:MWJames/Demo:Jqplotseries/reply

Thanks, and yes it would be nice if we can get contributions to improve the result formats/charts. As for your question, you should look foremost into the JS code but if you need extended information from properties/labels you might as well need to add those information into the js array coming from php.

PHP
Data objects are transferred from PHP to JS as JSON encode JS array. You can add information either by extending the array or by using ajax later in the process.

Method getResultData does more or less all the data and label gathering but any change in how the nested arrays are used will certainly need adjustments in other methods and the JS code itself.

JavaScript
In general the jqplotseries and jqplotchart both using the exact same JS code therefore is is vital to ensure that if changes are applied there work both ways.

The file ext.srf.jqplot.chart.js is the entry point for all chart types, it provides a general framework and if available distributes async calls to increase browsers responsiveness.

The bubble chart goes by ext.srf.jqplot.chart.bubble.js, bar/line/scatter plot goes by ext.srf.jqplot.chart.bar.js, and pie/donut goes by ext.srf.jqplot.chart.pie.js.

If you want to add a new chart type (mekko etc) that is not related to any other existing jqplot chart type you might add a new js file (such as ext.srf.jqplot.chart.mekko.js).

If you want to increase interactivity with charts you might want to look at the following resources that show examples in connection with jqplot.
 * JQPlot Bar Charts with HTML links
 * Axis labels in jqplot clickable
 * Tooltip and Custom Legend Highlighting
 * Animated Charts

Inline comments
Helping other contributors to understand the code is vital and keeps the code maintainable therefore comments are always appreciated and sometimes mandatory.

JShint
JS-code should be checked against jshint (see also here).