php+echarts实现数据可视化实例2

效果:

代码

php

<?php
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
?>
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="css/e-kanban/kanban.css"><script src="./js/jquery-2.1.0.js" type="text/javascript"></script><script src="./js/echarts.js" type="text/javascript"></script><title>电子看板</title>
</head><body><div class="kanban_all"><div class="kanban_all_position"><div class="kanban_line"><div class="kanban_title">工序待生产工时统计</div><div class="kanban_content"><table><tr><td><div id="poruku" style="width:100%;height:220px;"></div></td><td><div style="width: 30px; height:220px;"></div></td></tr></table></div></div><div class="kanban_line"><div class="kanban_title">近半年良率、不良率</div><div class="kanban_content"><?php$sql5 = "SELECT months.month,SUM(IFNULL(transaction_quantity, 0)) AS total_transaction_quantity,SUM(IFNULL(bad_quantity, 0)) AS total_bad_quantity,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(transaction_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS good_rate,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(bad_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS bad_rateFROM (SELECT DATE_FORMAT(DATE_SUB(LAST_DAY(CURDATE()), INTERVAL n.num MONTH), '%Y-%m') AS monthFROM (SELECT 0 AS num UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5) n) monthsLEFT JOIN wip_transactions ON DATE_FORMAT(FROM_UNIXTIME(transaction_date), '%Y-%m') = months.monthGROUP BY months.monthORDER BY months.month ASC";$result5 = DB_query($sql5, $db);// 检查查询是否成功if ($result5) {// 检查查询结果是否为空if (mysqli_num_rows($result5) > 0) {?><table class="table"><tr><th>月份</th><th>良品数量</th><th>不良数量</th><th>良品率 (%)</th><th>不良率 (%)</th></tr><?phpwhile ($row = mysqli_fetch_assoc($result5)) {?><tr><?php if ($row['bad_rate'] != 0) : ?><td style="color: red;"><?php echo $row['month']; ?></td><?php else : ?><td><?php echo $row['month']; ?></td><?php endif; ?><td><?php echo $row['total_transaction_quantity']; ?></td><td><?php echo $row['total_bad_quantity']; ?></td><td><?php echo $row['good_rate']; ?></td><?php if ($row['bad_rate'] != 0) : ?><td style="color: red;"><?php echo $row['bad_rate']; ?></td><?php else : ?><td><?php echo $row['bad_rate']; ?></td><?php endif; ?></tr><?php}?></table><?php} else {echo "No results found.";}} else {echo "Query failed.";}?></div></div><div class="kanban_line"><div class="kanban_line_double"><div class="left"><div class="kanban_title">近半年良品、不良率总计</div><div class="kanban_content"><table><tr><td><div id="poruku2" style="width:100%;height:220px;"></div></td><td><div style="width: 30px; height:220px;"></div></td></tr></table></div></div><div class="middle"></div><div class="right"><div class="kanban_title">全部良品、不良比率</div><div class="kanban_content"><table><tr><td><div id="poruku3" style="width:100%;height:220px;"></div></td><td><div style="width: 30px; height:220px;"></div></td></tr></table></div></div></div></div><div class="kanban_line"><div class="kanban_title">站别良品、不良率</div><div class="kanban_content"><table><tr><td><div id="poruku1" style="width:100%;height:220px;"></div></td><td><div style="width: 30px; height:220px;"></div></td></tr></table></div></div><div class="kanban_line"><div class="kanban_title">员工良品、不良比率</div><div class="kanban_content"><table><tr><td><div id="poruku4" style="width:100%;height:220px;"></div></td><td><div style="width: 30px; height:220px;"></div></td></tr></table></div></div><!-- <div class="kanban_line"><div class="kanban_title">员工工时</div><div class="kanban_content"><table><tr><td><div id="poruku6" style="width:100%;height:220px;"></div></td><td><div style="width: 30px; height:220px;"></div></td></tr></table></div></div> --></div></div>
</body></html><?php//按站别分的良率和不良率
$sql1 = "SELECT operation_code,SUM(IFNULL(transaction_quantity, 0)) AS total_transaction_quantity,SUM(IFNULL(bad_quantity, 0)) AS total_bad_quantity,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(transaction_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS good_rate,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(bad_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS bad_rateFROM wip_transactionsGROUP BY operation_codeORDER BY bad_rate desc
";
$result1 = DB_query($sql1, $db);
while ($array1 = mysqli_fetch_assoc($result1)) {$arrays1[] = $array1;
}if (is_array($arrays1)) {foreach ($arrays1 as $key => $value) {$goodnum1[]  = $value['total_transaction_quantity'];$badnum1[]  = $value['total_bad_quantity'];$arr_good_quantity1[]  = $value['good_rate'];$arr_bad_quantity1[]  = $value['bad_rate'];$arrvendor1[]  = $value['operation_code'];}
} else {$goodnum1[]  = 0;$badnum1[]  = 0;$arr_good_quantity1[]  = 0;$arr_bad_quantity1[]  = 0;$arrvendor1[]  = 0;
}
echo "<script>";
echo ";   var goodnum1 = ";
echo json_encode($goodnum1);
echo ";   var badnum1 = ";
echo json_encode($badnum1);
echo ";   var good_rate1 = ";
echo json_encode($arr_good_quantity1);
echo ";   var bad_rate1 = ";
echo json_encode($arr_bad_quantity1);
echo "; var x1 = ";
echo json_encode($arrvendor1);
echo "; var ydata = []var myChart1 = echarts.init(document.getElementById('poruku1')); option1 = {//滚动显示dataZoom: [{type: 'slider',  // 滑动条型式的dataZoom组件show: true,  // 显示dataZoom组件start: 0,  // 默认数据窗口范围的起始位置为0end: 30,  // 默认数据窗口范围的结束位置为30xAxisIndex: [0],  // 设置dataZoom组件影响的x轴索引,默认为第一个x轴filterMode: 'filter',  // 数据窗口范围的定义模式为filter过滤模式height: 15 // 设置滑动条型式的高度为20像素}, {type: 'inside',  // 内置型式的dataZoom组件start: 0,  // 默认数据窗口范围的起始位置为0end: 30,  // 默认数据窗口范围的结束位置为30xAxisIndex: [0],  // 设置dataZoom组件影响的x轴索引,默认为第一个x轴filterMode: 'filter',  // 数据窗口范围的定义模式为filter过滤模式height: 15 }],//图形颜色color: ['#5571c8','#91cc75'],//提示框,鼠标悬停在图形上的注解tooltip: {trigger: 'axis',axisPointer: {            // 坐标轴指示器,坐标轴触发有效type: 'line'        // 默认为直线,可选为:'line' | 'shadow'},formatter: function(params) {var index = params[0].dataIndex;var goodnum = goodnum1[index];var badnum = badnum1[index];var goodrate = params[0].value;var badrate = params[1].value;return '良品数量:' + goodnum + '<br>' +'不良数量:' + badnum + '<br>' +'良品率:' + goodrate + '%' + '<br>' +'不良率:' + badrate + '%';}},//配置网格组件,用于定义图表的位置和大小grid: {top: '15%',  // 增加top的值来创建间距left: '3%',right: '3%',bottom: '20%',  // 增加bottom的值来创建间距containLabel: true, //自动计算并包含坐标轴标签、刻度和标题等内容在内。},//横坐标xAxis: {name: '时间',nameTextStyle: {padding: [0, 0, -25, -25]    // 横坐标名称与原位置的边距},type: 'category', //横坐标数据类型为类别型,适用于离散的数据data: x1, //设置横坐标的数据,使用变量x1中的数据。axisLabel: {interval: 0, // 设置横坐标刻度的显示间隔,默认为0表示全部显示// 如果刻度标签太长,可以使用rotate进行旋转textStyle: {fontSize: 14}}},//比例yAxis: [{name: '比例',type: 'value', //数据类型为数值型。axisLabel: {formatter: '{value}%'},splitLine: {show: false  // 隐藏纵坐标轴的背景横线},},],series: [{name:'良品率',type: 'bar',data: good_rate1,barWidth: '30%', // 设置柱状图的宽度为整个类目宽度的40%barGap: '20%', // 设置柱状图之间的间距为整个类目宽度的20%itemStyle: {normal: {label: {show: true,position: 'top',formatter: '{c}%',textStyle: {color: 'black',fontSize: 10}}}}},{name:'不良率',type: 'bar',data: bad_rate1,barWidth: '30%', // 设置柱状图的宽度为整个类目宽度的40%barGap: '20%', // 设置柱状图之间的间距为整个类目宽度的20%itemStyle: {normal: {label: {show: true,position: 'top',formatter: '{c}%',textStyle: {color: 'black',fontSize: 10}}}}}]};myChart1.setOption(option1);    </script>";//计算机半年内的总良品和不良
$sql2 = "SELECT SUM(IFNULL(transaction_quantity, 0)) AS total_transaction_quantity,SUM(IFNULL(bad_quantity, 0)) AS total_bad_quantity,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(transaction_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS good_rate,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(bad_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS bad_rate,DATE(DATE_SUB(DATE_FORMAT(NOW(), '%Y-%m-%d'), INTERVAL 6 MONTH)) AS six_months_agoFROM wip_transactionsWHERE transaction_date >= UNIX_TIMESTAMP(DATE_SUB(DATE_FORMAT(NOW(), '%Y-%m-%d'), INTERVAL 6 MONTH))AND transaction_date <= UNIX_TIMESTAMP(DATE_FORMAT(NOW(), '%Y-%m-%d'));";
$result2 = DB_query($sql2, $db);
if ($array2 = mysqli_fetch_assoc($result2)) {$good_rate2 = $array2['good_rate'];$bad_rate2 = $array2['bad_rate'];$six_months_ago2 = $array2['six_months_ago'];
} else {$good_rate2 = 0;$bad_rate2 = 0;$six_months_ago2 = 0;
}
$array2 = array((object)array('value' => $good_rate2, 'name' => '良品率'),(object)array('value' => $bad_rate2, 'name' => '不良率')
);echo "<script>";
echo ";   var array2 = ";
echo json_encode($array2);
echo "; var ydata = []var myChart2 = echarts.init(document.getElementById('poruku2')); option2 = {title: {left: 'center',top: 'center'},color:['#e5924b','#00c5d4'],  tooltip: {trigger: 'item',formatter: '{b}: {c}%'  // 设置提示框内容格式,b代表数据项名称,c代表数据项值},series: [{type: 'pie',data: array2,radius: ['40%', '70%']}]};myChart2.setOption(option2);    </script>";//计算总的良品和不良
$sql3 = "SELECT SUM( IFNULL( transaction_quantity, 0 ) ) AS total_transaction_quantity, SUM( IFNULL( bad_quantity, 0 ) ) AS total_bad_quantity, CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(transaction_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS good_rate,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(bad_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS bad_rateFROM wip_transactions";
$result3 = DB_query($sql3, $db);
if ($array3 = mysqli_fetch_assoc($result3)) {$good_rate3 = $array3['good_rate'];$bad_rate3 = $array3['bad_rate'];
} else {$good_rate3 = 0;$bad_rate3 = 0;
}
$array3 = array((object)array('value' => $good_rate3, 'name' => '良品率'),(object)array('value' => $bad_rate3, 'name' => '不良率')
);echo "<script>";
echo ";   var array3 = ";
echo json_encode($array3);
echo "; var ydata = []var myChart3 = echarts.init(document.getElementById('poruku3')); option3 = {title: {left: 'center',top: 'center'},color:['#fc6696','#985afb'],  tooltip: {trigger: 'item',formatter: '{b}: {c}%'  // 设置提示框内容格式,b代表数据项名称,c代表数据项值},series: [{type: 'pie',data: array3,radius: ['40%', '70%']}]};myChart3.setOption(option3);    </script>";//计算总的良品和不良
$sql4 = "SELECT wt.employee_num,he.employee_name,SUM(IFNULL(wt.transaction_quantity, 0)) AS total_transaction_quantity,SUM(IFNULL(wt.bad_quantity, 0)) AS total_bad_quantity,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(transaction_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS good_rate,CASEWHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0ELSE ROUND((SUM(IFNULL(bad_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)END AS bad_rate
FROM wip_transactions wt, hr_employees he
WHERE wt.employee_num = he.employee_num-- AND transaction_date >= UNIX_TIMESTAMP(DATE_SUB(DATE_FORMAT(NOW(), '%Y-%m-%d'), INTERVAL 6 MONTH))-- AND transaction_date <= UNIX_TIMESTAMP(DATE_FORMAT(NOW(), '%Y-%m-%d'))
GROUP BYwt.employee_num
ORDER BYbad_rate desc
";
$result4 = DB_query($sql4, $db);
while ($array4 = mysqli_fetch_assoc($result4)) {$arrays4[] = $array4;
}if (is_array($arrays4)) {foreach ($arrays4 as $key => $value) {$good_rate4[]  = $value['good_rate'];$bad_rate4[]  = $value['bad_rate'];$goodnum4[]  = $value['total_transaction_quantity'];$badnum4[]  = $value['total_bad_quantity'];$employee_name[]  = $value['employee_name'];}
} else {$good_rate4[]  = 0;$bad_rate4[]  = 0;$goodnum4[]  = 0;$badnum4[]  = 0;$employee_name[]  = 0;
}
echo "<script>";
echo ";   var goodnum4 = ";
echo json_encode($goodnum4);
echo "; var badnum4 = ";
echo json_encode($badnum4);
echo ";   var good_rate4 = ";
echo json_encode($good_rate4);
echo "; var bad_rate4 = ";
echo json_encode($bad_rate4);
echo "; var employee_name = ";
echo json_encode($employee_name);
echo "; var ydata = []var myChart4 = echarts.init(document.getElementById('poruku4')); option4 = {//滚动显示dataZoom: [{type: 'slider',  // 滑动条型式的dataZoom组件show: true,  // 显示dataZoom组件start: 0,  // 默认数据窗口范围的起始位置为0end: 10,  // 默认数据窗口范围的结束位置为30xAxisIndex: [0],  // 设置dataZoom组件影响的x轴索引,默认为第一个x轴filterMode: 'filter',  // 数据窗口范围的定义模式为filter过滤模式height:15}, {type: 'inside',  // 内置型式的dataZoom组件start: 0,  // 默认数据窗口范围的起始位置为0end: 10,  // 默认数据窗口范围的结束位置为30xAxisIndex: [0],  // 设置dataZoom组件影响的x轴索引,默认为第一个x轴filterMode: 'filter',  // 数据窗口范围的定义模式为filter过滤模式height:15}],//配置网格组件,用于定义图表的位置和大小grid: {top: '12%',  // 增加top的值来创建间距left: '2%',right: '5%',bottom: '20%',  // 增加bottom的值来创建间距containLabel: true, //自动计算并包含坐标轴标签、刻度和标题等内容在内。},//横坐标xAxis: {name: '员工',data: employee_name, //设置横坐标的数据,使用变量employee_name中的数据。},//纵坐标yAxis: {axisLabel: {formatter: '{value}%',},splitLine: {show: false  // 隐藏纵坐标轴的背景横线},},//图形颜色color: ['#b381dd','#31a3ff'],//提示框,鼠标悬停在图形上的注解tooltip: {trigger: 'axis',axisPointer: {            // 坐标轴指示器,坐标轴触发有效type: 'line'        // 默认为直线,可选为:'line' | 'shadow'},formatter: function(params) {var index = params[0].dataIndex;var goodnum = goodnum4[index];var badnum = badnum4[index];var goodrate = params[0].value;var badrate = params[1].value;return employee_name[index] + '<br>' +'良品数量:' + goodnum + '<br>' +'不良数量:' + badnum + '<br>' +'良品率:' + goodrate + '%' + '<br>' +'不良率:' + badrate + '%';}},series: [{name:'良品率',data:good_rate4,type:'bar',stack:'x',  itemStyle: {normal: {label: {show: true,position: 'inside',formatter: '良率:{c}%',textStyle: {color: 'black',fontSize: 12}}}}},{name:'不良率',data:bad_rate4,type:'bar',stack:'x',itemStyle: {normal: {label: {show: true,position: 'top',formatter: '不良率:{c}%',textStyle: {color: 'black',fontSize: 12}}}}},],};myChart4.setOption(option4);    </script>";//查询站别的良率、不良率
// $sql5 = "SELECT 
//     operation_code,
//     SUM(IFNULL(transaction_quantity, 0)) AS total_transaction_quantity,
//     SUM(IFNULL(bad_quantity, 0)) AS total_bad_quantity,
//     CASE
//         WHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0
//         ELSE ROUND((SUM(IFNULL(transaction_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)
//     END AS good_rate,
//     CASE
//         WHEN (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0))) = 0 THEN 0
//         ELSE ROUND((SUM(IFNULL(bad_quantity, 0)) / (SUM(IFNULL(transaction_quantity, 0)) + SUM(IFNULL(bad_quantity, 0)))*100), 2)
//     END AS bad_rate
// FROM wip_transactions
// GROUP BY operation_code";
// $result5 = DB_query($sql5, $db);//员工工时
$sql6 = "SELECT wt.employee_num,he.employee_name,SUM((end_date - begin_date) / 3600) AS total_hours,SUM((end_date - begin_date) / (3600 * 24)) AS total_days,SUM((end_date - begin_date) / (3600 * 24 * 365)) AS total_years
FROM wip_transactions wt, hr_employees he
WHERE wt.employee_num = he.employee_num
GROUP BY wt.employee_num";
$result6 = DB_query($sql6, $db);
while ($array6 = mysqli_fetch_assoc($result6)) {$arrays6[] = $array6;
}
if (is_array($arrays6)) {foreach ($arrays6 as $key => $value) {$total_hours6[]  = $value['total_hours'];$total_days6[]  = $value['total_days'];$total_years6[]  = $value['total_years'];$employee_name6[]  = $value['employee_name'];}
} else {$total_hours6[]  = 0;$total_days6[]  = 0;$total_years6[]  = 0;$employee_name6[]  = 0;
}
echo "<script>";
echo ";   var employee_name6 = ";
echo json_encode($employee_name6);
echo ";   var total_hours6 = ";
echo json_encode($total_hours6);echo "; var data = []; var myChart6 = echarts.init(document.getElementById('poruku6')); option6 = {yAxis: {data: employee_name6},xAxis: {},series: [{type: 'bar',data: total_hours6}]};myChart6.setOption(option6);    </script>";// 待生产工时统计
$sql7 = "SELECT   a.operation_code,operation_name,sum(begin_quantity*standard_time) as paipei,sum(a.output_quantity*standard_time) wancheng,sum((begin_quantity-a.output_quantity)*standard_time) waitfrom wip_operation_plan a,bom_parameters b,wip_jobs_all cwhere  a.operation_code=b.operation_code and begin_quantity>a.output_quantity and standard_time>0and a.wip_entity_name=c.wip_entity_name GROUP BY a.operation_code,operation_nameorder by a.operation_code desc";
$result7 = DB_query($sql7, $db);while ($array7 = mysqli_fetch_assoc($result7)) {$arrays7[] = $array7;
}if (is_array($arrays7)) {foreach ($arrays7 as $key => $value) {$arramount7[]  = $value['wait'];$arrvendor7[]  = $value['operation_name'];}
} else {$arramount7[]  = 0;$arrvendor7[]  = 0;
}
echo "<script>";
echo ";   var num7 = ";
echo json_encode($arramount7);
echo "; var customer7 = ";
echo json_encode($arrvendor7);
echo "; var ydata = []var myChart7 = echarts.init(document.getElementById('poruku')); option7 = {//滚动显示dataZoom: [{type: 'slider',  // 滑动条型式的dataZoom组件show: true,  // 显示dataZoom组件start: 0,  // 默认数据窗口范围的起始位置为0end: 30,  // 默认数据窗口范围的结束位置为30xAxisIndex: [0],  // 设置dataZoom组件影响的x轴索引,默认为第一个x轴filterMode: 'filter',  // 数据窗口范围的定义模式为filter过滤模式height: 15 // 设置滑动条型式的高度为20像素}, {type: 'inside',  // 内置型式的dataZoom组件start: 0,  // 默认数据窗口范围的起始位置为0end: 30,  // 默认数据窗口范围的结束位置为30xAxisIndex: [0],  // 设置dataZoom组件影响的x轴索引,默认为第一个x轴filterMode: 'filter',  // 数据窗口范围的定义模式为filter过滤模式height: 15 }],//标题// title: {//     text: '工序待生产工时统计'// },//图形颜色color: ['#3398DB'],//提示框,鼠标悬停在图形上的注解tooltip: {trigger: 'axis',axisPointer: {            // 坐标轴指示器,坐标轴触发有效type: 'line'        // 默认为直线,可选为:'line' | 'shadow'}},//配置网格组件,用于定义图表的位置和大小grid: {top: '20%',  // 增加top的值来创建间距left: '3%',right: '3%',bottom: '20%',  // 增加bottom的值来创建间距containLabel: true, //自动计算并包含坐标轴标签、刻度和标题等内容在内。},//横坐标xAxis: {name: '工序',nameTextStyle: {padding: [0, 0, -25, -25]    // 横坐标名称与原位置的边距},type: 'category', //横坐标数据类型为类别型,适用于离散的数据data: customer7, //设置横坐标的数据,使用变量customer7中的数据。axisLabel: {interval: 0, // 设置横坐标刻度的显示间隔,默认为0表示全部显示// 如果刻度标签太长,可以使用rotate进行旋转textStyle: {fontSize: 14}}},//纵坐标yAxis: [{name: '工时',type: 'value', //数据类型为数值型。axisLabel: {interval: 0, // 设置横坐标刻度的显示间隔,默认为0表示全部显示// 如果刻度标签太长,可以使用rotate进行旋转textStyle: {fontSize: 14}},splitLine: {show: false  // 隐藏纵坐标轴的背景横线},},],series: [{name: '工时',type: 'bar',barWidth: '25%',data: num7,itemStyle: {normal: {label: {show: true,position: 'top',textStyle: {color: 'black',fontSize: 12}}}}},],};myChart7.setOption(option7);    </script>";

css

body {background-color: #f3f6fb;padding: 0px;margin: 0px;
}.kanban_all {/* border: 1px solid black; */width: 100%;display: flex;justify-content: center;align-items: center;
}.kanban_all_position {/* border: 1px solid black; */width: 98%;display: flex;flex-wrap: wrap;
}.kanban_line {/* border: 1px solid black; */width: calc(50% - 2%);margin: 1% 1% 0 1%;background-color: #fff;
}.kanban_title {background-color: #fff;padding: 2%;font-size: 120%;font-weight: bold;font-family: '华文细黑';border-left: 4px solid #75b2fa;border-bottom: 1px solid #f3f6fb;
}.kanban_content {padding: 1%;background-color: #fff;
}.kanban_content table {width: 100%;/* border: 1px solid green; */
}.kanban_content table td {width: 100%;/* 或者您可以根据需求设置其他百分比值,例如33.33% */
}.kanban_line_double {/* border: 1px solid blue; */display: flex;justify-content: center;width: 100%;height: 100%;
}.kanban_line_double .left {/* border: 1px solid red; */width: 48%;height: 100%;
}.kanban_line_double .left .kanban_title {padding: 4%;
}/* 
.kanban_line_double .left .kanban_content {padding: 2%;
} */.kanban_line_double .middle {background-color: #f3f6fb;width: 4%;
}.kanban_line_double .right {/* border: 1px solid black; */width: 48%;height: 100%;
}.kanban_line_double .right .kanban_title {padding: 4%;
}/*
.kanban_line_double .right .kanban_content {padding: 2%;
} *//* 表格 */
.table {text-align: center;/* border: 1px solid black; */border-collapse: collapse;
}.table tr th {width: 20%;/* border: 1px solid black; */color: #5a5a5a;font-weight: bold;
}.table tr td {width: 20%;text-align: center;padding-top: 1%;color: #5a5a5a;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/71031.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python使用matplotlib实现折线图的绘制

一、意义 数据可视化可以以简洁的方式呈现出数据&#xff0c;发现众多数据中隐藏的规律和意义。Matplotlib是一个数学绘图库。利用它可以制作简单的图表&#xff08;散点图、折线图&#xff09;。然后&#xff0c;将基于漫步概念生成一个更有趣的数据集–根据一系列随机决策生成…

讯飞星火、文心一言和通义千问同时编“贪吃蛇”游戏,谁会胜出?

同时向讯飞星火、文心一言和通义千问三个国产AI模型提个相同的问题&#xff1a; “python 写一个贪吃蛇的游戏代码” 看哪一家AI写的程序直接能用&#xff0c;谁就胜出&#xff01; 讯飞星火 讯飞星火给出的代码&#xff1a; import pygame import sys import random# 初…

Swift 基础

工程目录 请点击下面工程名称&#xff0c;跳转到代码的仓库页面&#xff0c;将工程 下载下来 Demo Code 里有详细的注释 点击下载代码&#xff1a;swift-01

爬虫逆向实战(十二)--某交易所登录

一、数据接口分析 主页地址&#xff1a;某交易所 1、抓包 通过抓包可以发现登录是通过表单提交的 2、判断是否有加密参数 请求参数是否加密&#xff1f; 通过查看“载荷”模块&#xff0c;可以发现有两个加密参数password和execution 请求头是否加密&#xff1f; 无响应是…

【大数据Hive】hive 事务表使用详解

目录 一、前言 二、Hive事务背景知识 hive事务实现原理 hive事务原理之 —— delta文件夹命名格式 _orc_acid_version 说明 bucket_00000 合并器(Compactor) 二、Hive事务使用限制 参数设置 客户端参数设置 客户端参数设置 三、Hive事务使用操作演示 操作步骤 客…

基于IMX6ULLmini的linux裸机开发系列二:使用C语言和SDK点亮LED

引入sdk头文件 sudo chown -R gec /opt 用这条命令给gec赋权限&#xff0c;否则访问权限不够&#xff0c;无法读取&#xff0c;如下图成功 目的&#xff1a;解决寄存器地址难查难设置 devices/MCIMX6Y2/MCIMX6Y2.h 记录外设寄存器及其相关操作 devices/MCIMX6Y2/drivers/fsl_…

CSAPP Lab2:Bomb Lab

说明 6关卡&#xff0c;每个关卡需要输入一个字符串&#xff0c;通过逆向工程来获取对应关卡的字符串 准备工作 环境 需要用到gdb调试器 apt-get install gdb系统: Ubuntu 22.04 本实验会用到的gdb调试器的指令如下 r或者 run或者run filename 运行程序,run filename就是…

数据生成 | MATLAB实现WGAN生成对抗网络数据生成

数据生成 | MATLAB实现WGAN生成对抗网络数据生成 目录 数据生成 | MATLAB实现WGAN生成对抗网络数据生成生成效果基本描述程序设计参考资料 生成效果 基本描述 1.WGAN生成对抗网络&#xff0c;数据生成&#xff0c;样本生成程序&#xff0c;MATLAB程序&#xff1b; 2.适用于MATL…

网络

mcq Java 传输层&#xff1a;拆分和组装&#xff0c;完成端到端的消息传递&#xff0c;流量控制&#xff0c;差错控制等 网络层&#xff1a; 寻址、路由&#xff0c;复用&#xff0c;拥塞控制&#xff0c;完成源到宿的传递。 显然A选项是错误的&#xff0c;有流量控制的是传输层…

爬虫逆向实战(三)--天某云登录

一、数据接口分析 主页地址&#xff1a;天某云 1、抓包 通过抓包可以发现登录接口是account/login 2、判断是否有加密参数 请求参数是否加密&#xff1f; 通过“载荷”模块可以发现password、comParam_signature、comParam_seqCode是加密的 请求头是否加密&#xff1f; 无…

数据结构—树表的查找

7.3树表的查找 ​ 当表插入、删除操作频繁时&#xff0c;为维护表的有序表&#xff0c;需要移动表中很多记录。 ​ 改用动态查找表——几种特殊的树 ​ 表结构在查找过程中动态生成 ​ 对于给定值key ​ 若表中存在&#xff0c;则成功返回&#xff1b; ​ 否则&#xff0…

vue中的路由缓存和解决方案

路由缓存的原因 解决方法 推荐方案二&#xff0c;使用钩子函数beforeRouteUpdate&#xff0c;每次路由更新前执行