pull/18/head
icret 2021-11-13 13:42:41 +08:00
parent 6aac1f6838
commit 751fe80a37
1 changed files with 36 additions and 10 deletions

View File

@ -40,17 +40,16 @@ if (is_array($char_data)) {
<div class="col-md-6">
<h4>文件统计(张)</h4>
<canvas id="myBarChart" width="960" height="400"></canvas>
<p>文件统计(张)</p>
</div>
<div class="col-md-6">
<h4 class=" col-md-offset-2">硬盘统计GB</h4>
<canvas id="diskPieChart" width="960" height="400"></canvas>
<h4 class=" col-md-offset-2"><?php printf("总空间:%1\$.2f GB 已用:%2\$.2f GB 剩余:%3\$.2f GB", disk_total_space('.') / 1024 / 1024 / 1024, (disk_total_space('.') - disk_free_space('.')) / 1024 / 1024 / 1024, disk_free_space('.') / 1024 / 1024 / 1024); ?></h4>
</div>
</div>
<div class="col-sm-12" style="text-align: center;">
<hr/>
<hr />
<h4>最近30上传趋势与空间占用上传/ 占用/MB</h4>
<h4 class="text-danger hidden-lg">手机请启用横屏浏览</h4>
<canvas id="myChart" width="1080" height="200"></canvas>
</div>
@ -70,13 +69,25 @@ if (is_array($char_data)) {
};
var options = {
responsive: true
}; // 图表配置项,可以留空来使用默认的配置
responsive: true,
scaleShowLabels: true, // 展示标签
scaleLabelPlacement: "outside",
// Interpolated JS string - 坐标刻度格式化文本
scaleLabel: "<%=value%>",
scaleShowLabels: true,
//Boolean - 是否启用缩放动画
animateScale: true,
// Number - 自定义坐标网格时起始刻度值
scaleStartValue: 0,
// Boolean - 是否启用响应式设计,在窗口尺寸变化时进行重绘
responsive: true,
};
var myBarChart = $('#myBarChart').barChart(data, options);
// 最近30上传趋势与空间占用-折线图
// 使用jquery方法获取 2d context 对象
// 最近30上传趋势与空间占用-折线图
var ctx = $("#myChart").get(0).getContext("2d");
// 使用$.zui.Chart构造Chart实例
@ -98,7 +109,14 @@ if (is_array($char_data)) {
}]
};
var options = {}; // 图表配置项,可以留空来使用默认的配置
var options = {
//Boolean - 是否启用缩放动画
animateScale: true,
// Number - 自定义坐标网格时起始刻度值
scaleStartValue: 0,
// Boolean - 是否启用响应式设计,在窗口尺寸变化时进行重绘
responsive: true,
};
var myLineChart = $("#myChart").lineChart(data, options);
@ -115,10 +133,18 @@ if (is_array($char_data)) {
// highlight: "#FF5A5E", // 自定义高亮颜色
label: "已用空间"
}];
// 图表配置项,可以留空来使用默认的配置
var options = {
scaleShowLabels: true, // 展示标签
scaleLabelPlacement: "outside",
// Interpolated JS string - 坐标刻度格式化文本
scaleLabel: "<%=value%>GB",
scaleShowLabels: true,
//Boolean - 是否启用缩放动画
animateScale: true,
// Number - 自定义坐标网格时起始刻度值
scaleStartValue: 0,
// Boolean - 是否启用响应式设计,在窗口尺寸变化时进行重绘
responsive: true,
};
// 创建饼图