Author: | vneri |
---|---|
Views Total: | 4,088 views |
Official Page: | Go to website |
Last Update: | November 19, 2018 |
License: | MIT |
Preview:

Description:
circleDonutChart is a standalone JS library for drawing animated, flexible and flat styled donut charts using SVG
objects.
How to use it:
Load the necessary circleDonutChart.js
in your document.
<script src="circleDonutChart.js"></script>
Create a DIV element into which the SVG based donut chart will be created.
<div id="example"></div>
Draw an animated donut chart into the DIV element.
var circle = new circleDonutChart('example'); circle.draw({ end:75, start:0, maxValue:100, titlePosition:"outer-top", titleText:"Your happiness", outerCircleColor:'#0085c8', innerCircleColor:'#909081' });
Available drawing options.
start
: starting value, ignored if chart already has a statusend
: ending value [mandatory]outerCircleColor
: ovverrides the color of outer circleinnerCircleColor
: ovverrides the color of inner circletextColor
: ovverrides the color of textanimationSpeed = 0
: no AnimationanimationSpeed = 1
: normal speedscaling
: scaling value, 1 for normalsize
: in px, the size of the chartgetValue()
: gets actual valuesetValue()
: sets a value without animationunitText
: sets the unit for the shown numbermaxValue
: optional parameter that overrides 100% with a maximal ValuetitleText
: A title for the Chart (less than 12 chars for inner-bottom and inner-top readibility)titlePosition
: where the title gets displayed, [“outer-bottom” | “outer-top” | “inner-bottom” | “inner-top”]titleColor
: ovverrides the standard colors for the titleangleOfStart
: the standard starting position is at 3 o’clock (90 degrees)- the value can be overridden. Values are from 0 to 360
Methods:
draw
: draws the chart based on the given optionsdraw (after first draw)
: omitting color options possiblesetValue
: sets a value, without animating the circlegetValue
: returns the actual valuedelete
: delete the chart objectreload
: reload the chart object and initialize with standard parameters
Changelog:
11/19/2018
- Added support for custom starting angles
is posible add 3d shadow to outer circle?
Hi sorry for my late response, didn’t know my chart was featured here. I could give it a look or if you want you can branch it on GitHub – unfortunately I didn’t have time to continue to improve it
Thanks for this!! Was looking for a simple animated donut chart for a web page.