Server IP : 150.95.80.236 / Your IP : 3.15.219.174 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/js/custom/documentation/charts/flotcharts/ |
Upload File : |
"use strict"; // Class definition var KTFlotDemoDynamic = function () { // Private functions var exampleDynamic = function () { var data = []; var totalPoints = 250; // random data generator for plot charts function getRandomData() { if (data.length > 0) data = data.slice(1); // do a random walk while (data.length < totalPoints) { var prev = data.length > 0 ? data[data.length - 1] : 50; var y = prev + Math.random() * 10 - 5; if (y < 0) y = 0; if (y > 100) y = 100; data.push(y); } // zip the generated y values with the x values var res = []; for (var i = 0; i < data.length; ++i) { res.push([i, data[i]]); } return res; } //server load var options = { colors: [KTUtil.getCssVariableValue('--bs-active-danger'), KTUtil.getCssVariableValue('--bs-active-primary')], series: { shadowSize: 1 }, lines: { show: true, lineWidth: 0.5, fill: true, fillColor: { colors: [{ opacity: 0.1 }, { opacity: 1 }] } }, yaxis: { min: 0, max: 100, tickColor: KTUtil.getCssVariableValue('--bs-light-dark'), tickFormatter: function(v) { return v + "%"; } }, xaxis: { show: false, }, colors: [KTUtil.getCssVariableValue('--bs-active-primary')], grid: { tickColor: KTUtil.getCssVariableValue('--bs-light-dark'), borderWidth: 0, } }; var updateInterval = 30; var plot = $.plot($("#kt_docs_flot_dynamic"), [getRandomData()], options); function update() { plot.setData([getRandomData()]); plot.draw(); setTimeout(update, updateInterval); } update(); } return { // Public Functions init: function () { exampleDynamic(); } }; }(); // On document ready KTUtil.onDOMContentLoaded(function () { KTFlotDemoDynamic.init(); });