unicoderns / OpenCharts

It's time to easier beautiful charts

Home Page:http://OpenCharts.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenCharts

It's time to easier beautiful charts.

See http://OpenCharts.org for more.

Why?

There's a lot of charts libraries outside, some too ugly, some others too complex, we are trying to solve that.

Instalation

bower install

Usage

Regular way

var data = [
    { label: "Category A", value: Math.random() * 100, color: "#9b3388" },
    { label: "Category B", value: Math.random() * 100, color: "#4f99fc" },
    { label: "Category C", value: Math.random() * 100, color: "#fe8a4d" },
];

// Configuring require
require.config({
    paths: {
        d3: "../bower_components/d3/d3.min"
    }
});

// Creating Charts
require(['opencharts'], function(opencharts) {
    // Pie
    var pie = new opencharts.Pie("#hola");
    pie.setSettings(oc_examples.pie());
    pie.create();
});

Experimental

var data = [
    { label: "Category A", value: Math.random() * 100, color: "#9b3388" },
    { label: "Category B", value: Math.random() * 100, color: "#4f99fc" },
    { label: "Category C", value: Math.random() * 100, color: "#fe8a4d" },
];
<opencharts-pie id="chart" data-object="data" />

Live update

var data2 = [
    { label: "Category A", value: Math.random() * 100, color: "#9b3388" },
    { label: "Category B", value: Math.random() * 100, color: "#4f99fc" },
    { label: "Category C", value: Math.random() * 100, color: "#fe8a4d" },
];

pie.setSettings(data2);
pie.update();

About

It's time to easier beautiful charts

http://OpenCharts.org

License:MIT License


Languages

Language:TypeScript 71.6%Language:JavaScript 25.3%Language:CSS 3.2%