UNPKG

chart.js

Version:

Simple HTML5 charts using the canvas element.

50 lines (41 loc) 973 B
'use strict'; var defaults = require('./core.defaults'); defaults._set('global', { responsive: true, responsiveAnimationDuration: 0, maintainAspectRatio: true, events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'], hover: { onHover: null, mode: 'nearest', intersect: true, animationDuration: 400 }, onClick: null, defaultColor: 'rgba(0,0,0,0.1)', defaultFontColor: '#666', defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", defaultFontSize: 12, defaultFontStyle: 'normal', showLines: true, // Element defaults defined in element extensions elements: {}, // Layout options such as padding layout: { padding: { top: 0, right: 0, bottom: 0, left: 0 } } }); module.exports = function() { // Occupy the global variable of Chart, and create a simple base class var Chart = function(item, config) { this.construct(item, config); return this; }; Chart.Chart = Chart; return Chart; };