From: Koenderink, N. <Nic...@wu...> - 2011-01-28 11:26:55
|
Hi all! We're happily working with the SemanticResultFormats extension (version 1.5.2), e.g. to make graphs in our wiki. We seem to be running into some javascript issues under IE 7 and 8 though. Under Firefox, the following query works out well. It shows the number of projects in our wiki with a certain fixed criterium and how these are distributed over the various parties (ketenschakel). I have added a Firefox-picture and a IE-picture of the query output to this mail. <table> <tr><td> {{#ask:[[Category:HiddenKetenschakelDuurzaamheidscriterium]][[HeeftCriterium::{{{Criterium}}}]] |mainlabel=- |?HeeftKetenschakel=Ketenschakel |?NumberProjectsKetenschakelDuurzaamheidscriterium=# proj. per criterium per schakel |order=descending |format=jqplotpie }} </td><td> {{#ask:[[Category:HiddenKetenschakelDuurzaamheidscriterium]][[HeeftCriterium::{{{Criterium}}}]]|mainlabel=- |?HeeftCriterium=Criterium |?HeeftKetenschakel=Ketenschakel |?NumberProjectsKetenschakelDuurzaamheidscriterium=# projecten |sort=NumberProjectsKetenschakelDuurzaamheidscriterium |order=descending }} </td></tr> </table> The problem seems to be caused by the fact that some parties have 0 projects for the fixed criterium. Firefox deals with this by not showing the empty pie chart bits. IE messes up the pie chart. The view source code option of the browser shows the following bit of code, in which the correct values from the query are given to the jqplot function: <!-- Head Scripts --> <script src="/d/skins/common/jquery.min.js?270"></script> <!--[if IE]><script language="javascript" type="text/javascript" src="/d/extensions/SemanticResultFormats/jqPlot/excanvas.min.js"></scr ipt><![endif]--> <script src="/d/extensions/SemanticResultFormats/jqPlot/jquery.jqplot.min.js?2 70"></script> <script src="/d/extensions/SemanticResultFormats/jqPlot/jqplot.pieRenderer.min .js?270"></script> <script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready(function(){ jQuery.jqplot.config.enablePlugins = true; plot1 = jQuery.jqplot('pie1', [[['Verwerkende industrie', 9], ['Retail', 0], ['Primaire producent', 38], ['Out of home', 0], ['Groothandel', 0], ['Grondstof', 9], ['Consument', 3], ['Bewerkende industrie', 0]]], { title: ' ', seriesDefaults: { renderer: jQuery.jqplot.PieRenderer, rendererOptions: { sliceMargin:2 } }, legend: { show:true } }); }); </script> Removing the empty pie slices from the plotting is possible, but not a good option in our case: we are creating similar plots for different criteria. For interpretation purposes, it is preferable that the yellow slice in each of the plots refers to the same party (ketenschakel). I hope anybody knows where the problem is: is it an IE problem, is it something that should be solved in the SemanticResultFormats extension? How to solve it? Or alternatively: is there a way to assign fixed colours to fixed parties in the pie (even if sometimes the pie slice is omitted)? Thanks a lot for thinking along! Nicole |