Giter Club home page Giter Club logo

radarchart's Introduction

diy-radarchart

Render a radar chart using d3.

view on requirebin

example

Let's render a chart w/ 4 data points!

var radarchart = require('diy-radarchart');

var target = document.getElementById('passions-chart');

var data = [
    {
        color: '#ccc',
        html: 'Hey there!',
        value: 1
    },
    {
        color: '#999',
        html: 'Hey there darker!',
        value: 3
    },
    {
        color: '#666',
        html: 'Hey there even darker!',
        value: 5
    },
    {
        color: '#333',
        html: 'Hey there the darkest!',
        value: 7
    }
];

radarchart(target, data, { size: 240 });

This would render a radar chart like:

Radar Sample

Note that the html is rendered in a .diy-tooltip element after the svg element and is unstyled in this example.

methods

var radarchart = require('diy-radarchart');

radarchart($el, data, [options])

Appends a svg element and .diy-tooltip element to $el.

$el is the target element. data should be an array of objects with color, html and value properties.

color is the base color (at 100%) that will generate the various shades for the given segment.

html is the html used to render within the tooltip element.

value should be the relative integer value to all data points that will be used to render the segements within the respective data point.

Sample data point:

{
    color: '#999',
    html: '<span>Hey</span>',
    value: 10
}

The chart can handle any number of data points and value amounts and handles averaging everything.

license

APACHE 2.0

radarchart's People

Contributors

derekr avatar

Stargazers

Antonio Forgione avatar JT5D avatar patrick piemonte avatar

Watchers

Adam Murray avatar Jack Perkins avatar Zach Klein avatar James Cloos 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.