Code Monkey home page Code Monkey logo

dataviz's Introduction

Dataviz

Library

drawDonut

A test project is available here

drawDonut( domElement , {
           size: number,
           value: number,
           total: number,
           unit: string,
           filledColor: #ffffff,
           unfilledColor:#ffffff,
           fontColor:#ffffff,
           bgColor: #ffffff,
           clockFace: boolean
          })

Defaults

{
 size: 100,
 value: 80,
 total: 100,
 unit: "Points",
 filledColor: #1abc9c,
 unfilledColor: #bccbcc,
 fontColor: #000000,
 bgColor: #ffffff,
 clockFace: False
} 

default

domElement is the elementID of the HTML DOM element that the donut should be placed in.

drawDonut(donutDiv2)

donuts

size is relative to the size of the domElement that contains the donut. The size parameter is interpreted in percentage terms. Default size is 100%.

drawDonut("donutDiv", {size: 35})

size35

value determines the percentage fill of the donut ring. It also updates the text inside the donut. Default value is 80.

drawDonut("donutDiv", {value: 40})

40

total is the maximum value that can be displayed in the donut. Default total is 100.

drawDonut("donutDiv", {value: 25, total: 30})

25points

units text string will be shown in the second line inside the donut - under the value text. Default units are "points".

drawDonut("donutDiv", {units: "hours"})

80hr

Please note that, if an empty string is passed, then text inside donut will be displayed as one single line, just displaying the value - which is centered.

drawDonut(donutDiv, {units: ""})

80

clockFace is a boolean value which provides a dial around the donut when true. This is a mighty useful way to visualize the time remaining as a donut. By default, clockFace is False.

drawDonut("donutDiv", {units: "hours", clockFace: True})

80tick 1

filledColor is the color of the donut that displays remaining resource whereas unfilledColor is the color of the donut that displays the spent resource. bgColor is used for applying a color to the background of the div (HTML DOM element) that the donut is placed in. This allows to make the donut blend in with whatever application background that it is used in.

fontColor is the color of the text inside the donut. This can be just the value text or the value along with the units text.

By default, the filled, unfilled, font and background colors are #00e676, #bdc3c7, #000000 and #ffffff.

drawDonut("donutDiv", {filledColor: #ff0000, unfilledColor: #ffffff, bgColor: #00bcd4, fontColor: #ffffff})

bg-color

dataviz's People

Contributors

swathi8 avatar moosicalbovine avatar

Watchers

Avinasha Shastry avatar Monodeep Bhattacharjee avatar James Cloos avatar  avatar Gary Saxer avatar  avatar Dan Spear avatar Rohan Roy avatar Gitanjali Pathania avatar Vamsi Krishna Kolli avatar Priyanka Gupta avatar Priyanka Kumari avatar dhruv baveja avatar  avatar  avatar  avatar Elavarasan avatar  avatar Rahul Karkera 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.