Giter VIP home page Giter VIP logo

circles's Introduction

Circles

Circles

Lightwheight JavaScript library that generates circular graphs in SVG. Now with animation.

Usage

Include the circles.js file in your HTML file. There are no dependencies.

Create a graph by calling:

Circles.create({
	id:         'circles-1',
	percentage: 43,
	radius:     60,
	width:      10,
	text:       7.13,
	colors:     ['#D3B6C6', '#4B253A'],
	duration: 	400
})

where

  • id - the DOM element that will hold the graph
  • percentage - the percentage dictating the smaller circle
  • radius - the radius of the circles
  • width - the width of the ring (optional, has value 10, if not specified)
  • text - the text to display at the centre of the graph (optional, the percentage will show if not specified)
  • colors - an array of colors, with the first item coloring the full circle (optional, it will be ['#EEE', '#F00'] if not specified)
  • duration - value in ms of animation's duration; defaults to 500; if null is passed, the animation will not run.

Styles

The styles have been specified inline to avoid external dependencies. But they can be overriden via CSS easily, being simply HTML elements.

To help with this, a few CSS classes have been exposed:

  • circles-wrp - the element containing the graph
  • circles-text - the element containing the text

Compatibility

Browsers that support SVG.

Desktop

  • Firefox 3+
  • Chrome 4+
  • Safari 3.2+
  • Opera 9+
  • IE9 +

Mobile

  • iOS Safari 3.2+
  • Android Browser 3+
  • Opera Mobile 10+
  • Chrome for Android 18+
  • Firefox for Android 15+

Inspirations

Code and ideas borrowed by:

Licence

Circles is licensed under the terms of the MIT License.

Changelog

  • 0.02 Add animation
  • 0.01 First release

circles's People

Contributors

rtsinani avatar rsalo avatar

Watchers

Sven Anders Robbestad 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.