Coder Social home page Coder Social logo

canvasjs's Introduction

CanvasJS

From the official site:

CanvasJS is an easy to use JavaScript & HTML5 Charts library built on Canvas element. It runs across devices including iPhone, iPad, Android, Windows Phone, Microsoft Surface, Desktops, etc. This allows you to create rich dashboards that work on all the devices without compromising on maintainability or functionality of your web application. CanvasJS comes with beautiful themes and is over 10x faster than conventional Flash and SVG Charts โ€“ resulting in lightweight, beautiful and responsive dashboards.

Disclaimer

I am not the owner of the code in this repository! The original can be found at http://canvasjs.com. It was released as CC for personal use and it needs to be licensed under commerical use - see terms here. This repository only addresses issues of code quality and leaking globals in the hope that the author pulls it and merges it with thier upstream.

Issues

This repo represents code quality fixes, including nearly 100 JSHINT issues, ranging from unused variables, missing or surplus semi colons, confusing code, bugs in tooltip colour implementations and the correction and removal of 10 global variables that were leaked inadvertently:

// globals fixed
["currentTheme","prop","type","fontSize","decimalSeparator","digitGroupSeparator","i","textBlock","text","labelEffectiveWidth","color"]

This version also exports itself as an AMD module if RequireJS or similar loader is available.

Additionally, a .jshintrc that passes has been added with reasonable directives and use strict is enforced.

In spite of all the fixes, the lack of functional tests I have means I cannot guarantee this version has not broken functionality I was not aware of or chart types I have not personally used. It seems to work fine with line/sline/area chart and the likes, which is what I needed.

I am NOT going to be supporting this so use at your own risk. It does seem very fast for the actual rendering.

Experimental fixes

Checkout branch split-gradient - which actually changes the following:

  • new charts need to register themselves via CanvasJS.registerChart
  • ported to external files: area, line, spline, stackedArea
  • constructor also now accepts an element instead of an id
  • small bug fixes and demos.

Demo of this: here

Building

Simple minification via uglify-js2 npm module.

$ npm install
...
$ npm run-script min

> [email protected] min /Users/dchristoff/projects/canvasjs
> node_modules/uglify-js2/bin/uglifyjs2 canvasjs.js -c -m -o canvasjs.min.js

canvasjs's People

Contributors

dimitarchristoff avatar ycjcl868 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.