Extension talk:Gchart4mw

Getting Data From Templates
Many thanks for this extension. I would love to generate Google Charts from data held in wiki templates/pages. e.g.



--86.138.17.210 23:21, 26 January 2009 (UTC)

Security Issues
This is a great wiki extension for public wikis. However, if your wiki is intranet based you may be sending info out that is sensitive (because Google renders the image from a url that is not secured). So at the very least you are sharing your data with Google and also with any one who picks up the communication.

Even with this draw back this is still a useful extension for internal wikis, it just needs to be clear that the data being charted is heading out on the internet. I modified gchart4mw.php to include a warning label. Here is the changed code:

// - function gfLinesRender( $input, $args, $parser ) { global $gchartWikiDefaults; global $gchartLinesDefaults;

gfChartInit ; gfArgsParseCommon ($gchartWikiDefaults); gfArgsParseCommon ($gchartLinesDefaults); gfArgsParseCommon ($args);

$retval = '';

// Insert a dislamer caption $retval = ' ';

return $retval; }

function gfBarsRender( $input, $args, $parser ) { global $gchartWikiDefaults; global $gchartBarsDefaults;

gfChartInit ; gfArgsParseCommon ($gchartWikiDefaults); gfArgsParseCommon ($gchartBarsDefaults); gfArgsParseCommon ($args);

$retval = '';

// Insert a dislamer caption $retval = ' ';

return $retval; }

function gfPieRender( $input, $args, $parser ) { global $gchartWikiDefaults; global $gchartPieDefaults;

gfChartInit ; gfArgsParseCommon ($gchartWikiDefaults); gfArgsParseCommon ($gchartPieDefaults); gfArgsParseCommon ($args);

$retval = '';

// Insert a dislamer caption $retval = ' ';

This will render the image looking like this:

Dear Vaccano,

you are right! All data of the charts is being transmitted to google. And altough it is scaled to a value between 0 and 100 before sending, it might be a security concern for sensitive data.

If you don´t mind I would like to add a disclaimer like yours to the next release of this extension - maybe configurable with a parameter in LocalSettings.php?

sincerely

--Lef73 20:23, 23 January 2008 (UTC)

Sounds great to me! I look forward to using your updated version. --Vaccano 19:15, 28 January 2008 (UTC)

Horizontal bug
When you flip the bar chart to be horizontal, it seems to flip the array of the items displayed. For instance:  Cars, 3 Cucumbers, 7 Iglos, 2 This will draw a chart where the numbers show up in the right order, but the names are flipped (Iglos come first, followed by cucumbers and then cars, rather than the other way around).

Horizontal bug, fix
Version  of 2008-01-05 does show a wrong order of labels in case of the Horizontal Bar. It can be easily fixed however by applying underneath fix to. Replace this code:

With this:

The key to the solution is reversing the labels in case of a horizontal bar, this happens in the extra line of code:

Note: The post on this site of this fix should be deleted when Google fixes this problem in their distributed version of gchart4mw.php.