HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/ielts-store/wp-content/plugins/automatewoo/admin/assets/js/dashboard.js
(function($) {

    var self;

    AW.Dashboard = {

        $el: $( '.automatewoo-dashboard-widgets' ),

        params: {},


        init: function() {
            self.params = automatewooDashboardLocalizeScript;
            self.initMasonry();
        },



        initMasonry: function() {
            self.$el.masonry({
                itemSelector: '.automatewoo-dashboard-widget',
                columnWidth: '.automatewoo-dashboard-widget-sizer',
                percentPosition: true,
                gutter: 20,
                transitionDuration: '0.2s'
            });
        },


        drawGraph: function( id, data, params ) {

            var $chart = $( '#' + id );
            var sets = [];
            var setColors = [ '#3498db', '#d0a0e4', '#72c9b2' ];

            _.each( data, function( values, name ) {
                var set = {
                    label: '',
                    data: values,
                    color: setColors.shift(),
                    points: {
                        show: true,
                        radius: 3,
                        lineWidth: 2,
                        fillColor: '#ffffff',
                        fill: true
                    },
                    lines: {
                        show: true,
                        lineWidth: 2,
                        fill: true,
                        fillColor: { colors: [ { opacity: 0.02 }, { opacity: 0.16 } ] }
                    },
                    shadowSize: 0,
                    isCurrency: params.is_currency
                };

                if ( _.size( data ) > 1 ) {
                    set.lines.fill = false;
                }

                sets.push( set );
            });


            var options = {
                legend: {
                    show: false
                },
                grid: {
                    color: '#aaa',
                    borderColor: 'transparent',
                    borderWidth: 0,
                    hoverable: true
                },
                xaxis: {
                    color: '#e5e5e5',
                    position: "bottom",
                    tickColor: 'transparent',
                    mode: "time",
                    monthNames: AW.params.locale.month_abbrev,
                    tickLength: 1,
                    font: {
                        color: "#aaa"
                    }
                },
                yaxis: {
                    color: '#fff',
                    font: {
                        color: "#fff"
                    }
                }
            };


            if ( params.interval == 30 ) {
                options.xaxis.minTickSize = [ 4, 'day' ];
            }


            $.plot( $chart, sets, options );


            $chart.on( 'plothover', function( event, pos, item ) {

                var $wrap = $chart.parents( '.automatewoo-dashboard-chart:first' );
                var $tooltip = $chart.siblings( '.automatewoo-dashboard-chart__tooltip:first' );
                var wrap_offset = $wrap.offset();

                if ( item && item.series.points.show ) {

                    var content = item.datapoint[1];

                    if ( item.series.isCurrency ) {
                        content = AW.price( content );
                    }

                    $tooltip.html( content )
                        .css({
                            top: item.pageY - 9 - wrap_offset.top,
                            left: item.pageX + 12 - wrap_offset.left
                        })
                        .fadeIn( 200 );
                } else {
                    $tooltip.hide();
                }
            });

        }

    };

    self = AW.Dashboard;
    self.init();

})(jQuery);