Sha256: aaf62d6aee6526747893e3082c20720b37ab3d1078858d12a8a285d8a846a2a4

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

$(function() {

    var $dashboardSalesBreakdownChart = $('#dashboard-sales-breakdown-chart');

    if (!$dashboardSalesBreakdownChart.length) {
        return false;
    } 

    function drawSalesChart(){

    $dashboardSalesBreakdownChart.empty();

        Morris.Donut({
            element: 'dashboard-sales-breakdown-chart',
            data: [{ label: "Download Sales", value: 12 },
                { label: "In-Store Sales", value: 30 },
                { label: "Mail-Order Sales", value: 20 } ],
            resize: true,
            colors: [
                tinycolor(config.chart.colorPrimary.toString()).lighten(10).toString(),
                tinycolor(config.chart.colorPrimary.toString()).darken(8).toString(),
                config.chart.colorPrimary.toString()
            ],
        });

        var $sameheightContainer = $dashboardSalesBreakdownChart.closest(".sameheight-container");

        setSameHeights($sameheightContainer);
    }

    drawSalesChart();

    $(document).on("themechange", function(){
       drawSalesChart();
    });
    
})

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_modular_admin-0.2.4 app/assets/javascripts/rails_modular_admin/app/dashboard/sales-breakdown/sales-breakdown.js
rails_modular_admin-0.2.3 app/assets/javascripts/rails_modular_admin/app/dashboard/sales-breakdown/sales-breakdown.js
rails_modular_admin-0.2.2 app/assets/javascripts/rails_modular_admin/app/dashboard/sales-breakdown/sales-breakdown.js
rails_modular_admin-0.2.0 app/assets/javascripts/rails_modular_admin/app/dashboard/sales-breakdown/sales-breakdown.js