GithubHelp home page GithubHelp logo

angular-flow-chartjs's Introduction

Flow ChartJS

flowChartJs is an example of chart plugin for Angular Flow Chart, using ChartJS via Angular Chart

Install via Bower

bower install angular-flow-chartjs --save

Add script tag to your index.html

<script src="bower_components/angular-flow-chartjs.js"></script>

Include the ngFlowChartJs module as a dependency to your module:

angular.module('app', ['ngFlowChartJs', 'ngFlowChart', 'flowthings'])

Full example here

Options

  • chartType: string representing one of chart types supported by ChartJS (line, bar, radar, pie, polar-area, doughnut)
  • chartOptions: options object to be passed to ChartJS (check the official docs for more info)
  • valueProperties: string or an array of strings each representing a path to property of the data object to be used as graph value. If array is passed, a graph will be drawn for each path. Strings should be in path.to.prop form
  • valueDefaults: number or an array of numbers to be used as a default if the data point object doesn't contain property in the given path. Defaults to null, resulting in graph points not being drawn. If a single value is passed, it will be used as default for all graphs
  • labelProperty: string or boolean. If string is passed, it will be used as a path to a property of the data object to be used as label. It should be in path.to.prop form. Passing true will generate auto incremented labels, starting at 0. Passing false will not display labels
  • labelDefault: used if labelProperty is passed. Number representing default label value if the data point object doesn't contain property in the given label path
  • series, click, hover, legend and colours are directly passed to Angular Chart directive

Example usage

<!-- main.html -->

<flow-chart flow-id="flowId" limit="20">
    <flow-chart-js
        value-properties="chart.valueProp"
        value-defaults="chart.valueDefaults"
        label-property="chart.labelProperty"
        chart-type="line"
        chart-options="chart.options"
        series="chart.series"
        legend="chart.legend">
    </flow-chart-js>
</flow-chart>
/* main.js */

angular.module('ngFlowThingsApp')
    .controller('MainCtrl', function ($scope) {
        $scope.flowId = '< your Flow ID >';

        $scope.chart = {
            options: {
                animation: false
            },
            series: ['Inside Temperature', 'Outside Temperature'],
            valueProp: ['inside.temperature', 'outside.temperature'],
            /* or valueProp: 'inside.humidity' */
            valueDefaults: 0,
            /* or valueDefaults: [3, -7] */
            labelProperty: 'datetime'
            /* or labelProperty: true */
            legend: true
        }
    });

angular-flow-chartjs's People

Contributors

sljux avatar

Watchers

 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.