From: James HK <jam...@gm...> - 2012-03-15 22:56:20
|
Hi, While testing MW 1.19beta we had some trouble with the current jqPlot JavaScript implementation and we decided for a bold move and do some major re-work [1] of the current jqPlot Bar and jqPlot Pie chart which resulted in the following changes: The SRF jqPlot module now requires the ResourceLoader to work with. jqPlot, D3 and JitGraph now share similar parameter definitions and PHP methods which should keep maintenance easier. jqPlot now comes with 4 chart/scale renderer (pie, bar, line, and donut) ## Technology change Beginning with SRF 1.8 inline JavaScript is generally discouraged in favour of MW's ResourceLoader module therefore all JavaScript have been transferred to corresponding resource files (ext.srf.jqplot....). jqPlot data objects are using mw.config.set/mw.config.get to get access to embedded data objects. ## New features The parameter [renderer] has been introduced to select available jqPlot renderer (pie, donut graph and bar, line graph). (D3 uses a similar method now) All jqPot formats can use the parameter [charttext] to display explanatory text at the bottom of each chart. The parameter [chartclass] can be used to assign an additional css class to change the position or add/change margin settings of a chart (float:right/float:left etc.). The parameter [valueformat] has been introduced to allow individual value formatting. (%d a signed integer is the default setting but %.2f would round numbers to 2 digits after decimal point and can be combined notions like EUR %.2f, $ %.2f ) Themes (parameter [theme]) now can be customized using jqPlot themeEngine and are available for all jqPlot renderer in ext.srf.jqplot.themes.js. A colorscheme (parameter[colorscheme]) has been introduced using patterns from colorCombs and color scales developed by Cynthia Brewer. (D3 and jPlot share the same colorschemes). Other added parameters are [smoothlines], [highlighter], [ticklabels] An experimental new format (jqplotseries, SRF_jqPlotSeries.php) has been added as well allowing to combine numercial data sets and to be displayed as a chart series. Staked bar or line series are supported as well. The jqplotseries does work but need thorough testing and should not be used in production. (If you get in trouble with this module, please try to fixed yourself first.) ## Changes The split between JavaScript and PHP made changes necessary to ensure consistency with the data model and despite our efforts we tried to avoid any disruption of existing default behaviour but in some instances it could not have been avoided. The following jqPlot Pie parameters have been changed and could result in a slightly different display behaviour. [datalabeltype] has been deprecated and is replaced by [datalabels] which will have either none or 'percent','value', 'label' option [legendlocation] has been deprecated and is replaced by [chartlegend] which now combines the selection. The following jqPlot Bar parameters have been changed. [barcolor] has been deprecated and is replaced by chartcolor (a shared parameter with other chart modules) ## Plug-In The plug-in has been updated to version 1.0.0b2_r947. ## Unit tests SWM 1.7.1 and SRF 1.7.1 and MW 1.18, MW 1.19.0beta Chrome 11.0.700.3 and 17.0.963.66, IE 9, Mozilla/5.0, Firefox/3.6.23 [1] https://github.com/mwjames/smw-srfjqplot A patch will be available for bugzilla later on. Cheers mwjames |