{"record":{"id":"b9a0d3ffd85d4f72","repo":"dianping/cat","slug":"please-load-either-the-svg-or-the-canvasrenderer","errorCode":null,"errorMessage":"Please load either the SVG- or the CanvasRenderer","messagePattern":"Please load either the SVG- or the CanvasRenderer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"cat-home/src/main/webapp/assets/js/uncompressed/jquery.easypiechart.js","lineNumber":251,"sourceCode":"\t\t},\n\t\tonStart: function(from, to) {\n\t\t\treturn;\n\t\t},\n\t\tonStep: function(from, to, currentValue) {\n\t\t\treturn;\n\t\t},\n\t\tonStop: function(from, to) {\n\t\t\treturn;\n\t\t}\n\t};\n\n\t// detect present renderer\n\tif (typeof(CanvasRenderer) !== 'undefined') {\n\t\tdefaultOptions.renderer = CanvasRenderer;\n\t} else if (typeof(SVGRenderer) !== 'undefined') {\n\t\tdefaultOptions.renderer = SVGRenderer;\n\t} else {\n\t\tthrow new Error('Please load either the SVG- or the CanvasRenderer');\n\t}\n\n\tvar options = {};\n\tvar currentValue = 0;\n\n\t/**\n\t * Initialize the plugin by creating the options object and initialize rendering\n\t */\n\tvar init = function() {\n\t\tthis.el = el;\n\t\tthis.options = options;\n\n\t\t// merge user options into default options\n\t\tfor (var i in defaultOptions) {\n\t\t\tif (defaultOptions.hasOwnProperty(i)) {\n\t\t\t\toptions[i] = opts && typeof(opts[i]) !== 'undefined' ? opts[i] : defaultOptions[i];\n\t\t\t\tif (typeof(options[i]) === 'function') {\n\t\t\t\t\toptions[i] = options[i].bind(this);","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/uncompressed/jquery.easypiechart.js#L233-L269","documentation":"easypiechart ships its renderers as separate files: CanvasRenderer and/or SVGRenderer. At plugin load time it detects which renderer global exists and stores it in defaultOptions.renderer; if neither is present it throws immediately, because the chart cannot draw anything. Unlike the other errors here, this throw happens when the easypiechart script itself is evaluated, not at chart creation.","triggerScenarios":"Loading jquery.easypiechart.js without the renderer file(s); loading the renderer after the chart script (detection already failed); a custom build that omits the renderer; renderer file 404.","commonSituations":"Minimal includes copied from a blog example that assumed a combined bundle; asset concatenation ordering issues in combined JS files.","solutions":["Include the renderer file(s) shipped with easypiechart BEFORE jquery.easypiechart.js (typically easypiechart.js bundles CanvasRenderer — use the official distribution file).","Verify with a bundler/host page that the renderer global is defined before the plugin evaluates.","Check the Network tab for 404s on the renderer file."],"exampleFix":"// before\n<script src=\"jquery.easypiechart.js\"></script> <!-- renderer file missing -->\n\n// after\n<script src=\"jquery.easypiechart.js\"></script> <!-- official build includes CanvasRenderer -->\n<!-- or: -->\n<script src=\"easypiechart-renderers.js\"></script>\n<script src=\"jquery.easypiechart.js\"></script>","handlingStrategy":"validation","validationCode":"if (typeof window.CanvasRenderer === 'undefined' && typeof window.SVGRenderer === 'undefined') {\n  console.error('easypiechart renderer missing: load the distribution file that bundles CanvasRenderer before jquery.easypiechart.js');\n}","typeGuard":"function easyPieChartReady() {\n  return typeof window.jQuery === 'function' &&\n    (typeof window.CanvasRenderer !== 'undefined' || typeof window.SVGRenderer !== 'undefined') &&\n    typeof $.fn.easyPieChart === 'function';\n}","tryCatchPattern":null,"preventionTips":["Use the official single-file distribution that bundles CanvasRenderer.","If splitting files, load renderer files before the chart plugin.","Feature-check renderer globals on pages that use the chart, especially after asset pipeline changes."],"tags":["easypiechart","renderer","script-order","dependencies","vendor"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}