jquery.jqplot.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**
  2. * jqPlot
  3. * Pure JavaScript plotting plugin using jQuery
  4. *
  5. * Version: @VERSION
  6. * Revision: @REVISION
  7. *
  8. * Copyright (c) 2009-2013 Chris Leonello
  9. * jqPlot is currently available for use in all personal or commercial projects
  10. * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
  11. * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
  12. * choose the license that best suits your project and use it accordingly.
  13. *
  14. * Although not required, the author would appreciate an email letting him
  15. * know of any substantial use of jqPlot. You can reach the author at:
  16. * chris at jqplot or see http://www.jqplot.com/info.php .
  17. *
  18. * If you are feeling kind and generous, consider supporting the project by
  19. * making a donation at: http://www.jqplot.com/donate.php .
  20. *
  21. * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
  22. *
  23. * version 2007.04.27
  24. * author Ash Searle
  25. * http://hexmen.com/blog/2007/03/printf-sprintf/
  26. * http://hexmen.com/js/sprintf.js
  27. * The author (Ash Searle) has placed this code in the public domain:
  28. * "This code is unrestricted: you are free to use it however you like."
  29. *
  30. */
  31. /**
  32. *
  33. * This is a boot loader for the source version of jqplot.
  34. * It will load all of the necessary core jqplot files that
  35. * are concated together in the distribution.
  36. *
  37. */
  38. (function(){
  39. var getRootNode = function(){
  40. // figure out the path to this loader
  41. if(this["document"] && this["document"]["getElementsByTagName"]){
  42. var scripts = document.getElementsByTagName("script");
  43. var pat = /jquery\.jqplot\.js/i;
  44. for(var i = 0; i < scripts.length; i++){
  45. var src = scripts[i].getAttribute("src");
  46. if(!src){ continue; }
  47. var m = src.match(pat);
  48. if(m){
  49. return {
  50. node: scripts[i],
  51. root: src.substring(0, m.index)
  52. };
  53. }
  54. }
  55. }
  56. };
  57. var files = ['jqplot.core.js', 'jqplot.linearTickGenerator.js', 'jqplot.linearAxisRenderer.js', 'jqplot.axisTickRenderer.js', 'jqplot.axisLabelRenderer.js', 'jqplot.tableLegendRenderer.js', 'jqplot.lineRenderer.js', 'jqplot.markerRenderer.js', 'jqplot.divTitleRenderer.js', 'jqplot.canvasGridRenderer.js', 'jqplot.linePattern.js', 'jqplot.shadowRenderer.js', 'jqplot.shapeRenderer.js', 'jqplot.sprintf.js', 'jsdate.js', 'jqplot.themeEngine.js', 'jqplot.toImage.js', 'jqplot.effects.core.js', 'jqplot.effects.blind.js'];
  58. var rn = getRootNode().root;
  59. for (var i=0; i<files.length; i++) {
  60. var pp = rn+files[i];
  61. try {
  62. document.write("<scr"+"ipt type='text/javascript' src='"+pp+"'></scr"+"ipt>\n");
  63. } catch (e) {
  64. var script = document.createElement("script");
  65. script.src = pp;
  66. document.getElementsByTagName("head")[0].appendChild(script);
  67. // avoid memory leak
  68. script = null;
  69. }
  70. }
  71. })();