Skip to content

Simple Django Dashing widget to display a knob chart. Using jQuery Knob

Notifications You must be signed in to change notification settings

torstenfeld/django-dashing-widget-knob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

django-dashing-widget-knob

Simple Django Dashing widget to display a knob chart. Using jQuery Knob

Knob Widget

Usage

Add knob to INSTALLED_WIDGETS and finally add the following code to your dashing javascript configuration file.

<dashboard>.addWidget('knob_widget', 'Knob', {
    data: {
        title: 'Twitter followers',
        more_info: 'for @thisisjustaplaceholder',
        value: 0
    },
    interval: 5000, // 30 min

    getData: function () {
        var self = this;

        $.extend(self.data, {
            value: 23,
            data: {
                angleArc: 250,
                fgColor: '#90ee90',
                angleOffset: -125,
                displayInput: true,
                displayPrevious: false,
                step: 1,
                min: 0,
                max: 10000,
                readOnly: true
            }
        });
        self.data.value = Math.floor((Math.random() * 10000) + 1);;
        self.data.updated_at = lastUpdate();

        home.publish('knob/render');
        $('.dashing-knob').trigger('change');
    }
});

Replacing <dashboard> for your dashboard name.

About

Simple Django Dashing widget to display a knob chart. Using jQuery Knob

Resources

Stars

Watchers

Forks

Packages