PHP Classes

File: vendors/jquery-sparkline/src/simpledraw.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/jquery-sparkline/src/simpledraw.js   Download  
File: vendors/jquery-sparkline/src/simpledraw.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 2,029 bytes
 

Contents

Class file image Download
// Provide a cross-browser interface to a few simple drawing primitives $.fn.simpledraw = function (width, height, useExisting, interact) { var target, mhandler; if (useExisting && (target = this.data('_jqs_vcanvas'))) { return target; } if ($.fn.sparkline.canvas === false) { // We've already determined that neither Canvas nor VML are available return false; } else if ($.fn.sparkline.canvas === undefined) { // No function defined yet -- need to see if we support Canvas or VML var el = document.createElement('canvas'); if (!!(el.getContext && el.getContext('2d'))) { // Canvas is available $.fn.sparkline.canvas = function(width, height, target, interact) { return new VCanvas_canvas(width, height, target, interact); }; } else if (document.namespaces && !document.namespaces.v) { // VML is available document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', '#default#VML'); $.fn.sparkline.canvas = function(width, height, target, interact) { return new VCanvas_vml(width, height, target); }; } else { // Neither Canvas nor VML are available $.fn.sparkline.canvas = false; return false; } } if (width === undefined) { width = $(this).innerWidth(); } if (height === undefined) { height = $(this).innerHeight(); } target = $.fn.sparkline.canvas(width, height, this, interact); mhandler = $(this).data('_jqs_mhandler'); if (mhandler) { mhandler.registerCanvas(target); } return target; }; $.fn.cleardraw = function () { var target = this.data('_jqs_vcanvas'); if (target) { target.reset(); } };