create new tag
, view all tags

JqPlotPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on JqPlotPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please file bug reports in the JqPlotPlugin bug database.

Feedback on JqPlotPlugin

-- MahiroAndo - 2012-11-14

Thank you Mahiro for contributing this plugin!

I created supporting topics JqPlotPluginDev, JqPlotPluginAppraisal and Support.JqPlotPlugin. I also tagged the plugin topic.

-- PeterThoeny - 2012-11-14

The plugin works fine here for data inside thelocal TWIki realm. One of users has requested to include a JSON file from another domain. Is there any precondition to being able to read a JSON file that is hosted at an server outside the realm of Twiki domain ? This is an example code:

<div id='chart_r' style='height:280px; width: 500px;'></div>
$.getJSON('http://www.anotherdomain.com/test.json', function (data) {
$.jqplot('chart_r', [data.test, data.troll]);

-- Peter Jones - 2013-07-17

Hi Peter Jones,

That's an interesting use case. In our company, we have a kind of generic way to work around the cross-domain issue with a custom script connect under TWiki cgi-bin, so you can write:

$.getJSON('%SCRIPTURLPATH{connect}%?url=http://www.anotherdomain.com/test.json', ...);

It can be implemented with TWiki::Func::getExternalResource($url, [], {handlers => {...}}) where

handlers => {
  response_header => sub {print $_[0]->headers->as_string, "\n"; return},
  response_data => sub {print $_[3]; return 1},

Alternatively, the below may work:

var data = $.parseJSON('%INCLUDE{"http://www.anotherdomain.com/test.json"}%');
$.jqplot('chart_r', [data.test, data.troll]);

Hope this helps.

-- Mahiro Ando - 2013-07-18

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2013-07-18 - MahiroAndo
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.