<template>
<!-- 稽核日志界面 -->
<div class="tile is-parent test ">
<article class="tile is-child box">
<Card>
<Row :gutter="16">
<Col span="12">
<div id="echartContainer" style="width:500px; height:300px " ></div>
</Col>
<Col span="12">
<div id="echartContainer2" style="width:500px; height:300px " ></div>
</Col>
</Row>
</Card>
<br/>
<br/>
<TableHead headName="稽核列表"></TableHead>
<Table size="small" border :columns="columnsName" :data="dataList"></Table>
<Row type="flex" justify="space-between">
<Col span="4">
</Col>
<Col>
</Col>
</Row>
</article>
</div>
</template>
<script>
import Vue from 'vue'
import axios from 'axios'
import TableHead from 'component/TableHead.vue'
var echarts = require('echarts')
export default {
components: {
TableHead
},
mounted: function() {
this.$Notice.config({
top: 150,
duration: 3
});
this.query();
},
name: 'debug',
data: function() {
return {
dataList:[],
columnsName:
[
{
title: "序號",
type: "index",
fixed: 'left',
width: 75,
},
{
title: "文件日期",
key: 'fileDate',
width: 130,
},
{
title: "入庫文件數(shù)",
key: 'filesCloud',
width: 130
},
{
title: "源文件數(shù)",
key: 'filesBill',
width: 130,
},
{
title: "入庫條數(shù)",
key: 'rowsCloud',
width: 130,
},
{
title: "源文件總條數(shù)",
key: 'rowsBill',
width: 130,
},
{
title: "文件差值",
key: 'fileDiff',
width: 130,
},
{
title: "總行數(shù)差值",
key: 'rowsDiff',
width: 130,
},
{
title: "稽核時間",
key: 'checkDate',
width: 160,
},
{
title: "更新時間",
key: 'updateDate',
width: 160,
},
],
}
},
methods: {
query: function() {
let that = this
that.loading=true;
axios.get("CheckBillsController/queryCheckBills",
{
})
.then(function(res) {
let charData =res.data.data;
that.total = res.data.data.dataList.datasize;
that.dataList=res.data.data.dataList;
that.open(charData);
})
.catch(function(err) {
console.log(err)
})
that.loading=false;
},
open(charData)
{
let that=this
//文件稽核
var myChartFile = echarts.init(document.getElementById('echartContainer'));
//行數(shù)稽核
var myChartRows = echarts.init(document.getElementById('echartContainer2'));
// 繪制文件稽核圖表
myChartFile.setOption(
{
title:
{
text: "文件稽核"
},
tooltip:
{
trigger: 'axis'
},
axisPointer :
{ // 坐標軸指示器荡澎,坐標軸觸發(fā)有效
type : 'shadow' // 默認為直線,可選為:'line' | 'shadow'
},
//圖形類目
legend:
{
data:['入庫文件數(shù)','源文件數(shù)','源文件數(shù)差值']
},
//圖形工具欄
toolbox:
{
show : true,
feature : {
magicType : {show: true, type: ['line', 'bar']},
}
},
calculable : true,
xAxis:
{
data: charData.time,
axisLabel:
{
//設置x軸文字傾斜顯示
interval:0,
rotate:40
},
//設置x軸文字長度自動適應
grid:
{
left: '10%',
bottom:'35%'
}
},
yAxis:
{
//坐標顯示內(nèi)容
axisLabel:
{
margin: 2,
formatter: function (value, index) {
if (value <= -10000000) {
value = value / 100000000 + "億";
}
else if (value <= -10000 && value > -10000000) {
value = value / 10000 + "萬";
}
else if (value >= 10000 && value < 10000000) {
value = value / 10000 + "萬";
}
else if (value >= 10000000 && value < 100000000) {
value = value / 10000000 + "千萬";
}
else if (value > 100000000 ) {
value = value / 100000000 + "億";
}
return value;
}
}
},
series:
[
{
name: '入庫文件數(shù)',
type: 'bar',
data: charData.cloudFiles,
//柱子顏色
itemStyle:{
normal:
{
color:'#4ad2ff'
}
},
},
{
name: '源文件數(shù)',
type: 'bar',
data: charData.billFiles,
itemStyle:{
normal:
{
color:'#9966ff'
}
},
},
{
name: '源文件數(shù)差值',
type: 'bar',
data: charData.diffFiles,
itemStyle:
{
normal:
{
color:'#434343'
}
},
}
]
});
myChartRows.setOption(
{
title: { text: "總行數(shù)稽核" },
tooltip : {
trigger: 'axis',
},
axisPointer : { // 坐標軸指示器晤锹,坐標軸觸發(fā)有效
type : 'shadow' // 默認為直線,可選為:'line' | 'shadow'
},
legend: {
data:['入庫總行數(shù)','源文件總行數(shù)','總行數(shù)差值']
},
toolbox: {
show : true,
feature : {
magicType : {show: true, type: ['line', 'bar']},
}
},
calculable : true,
xAxis: {
data: charData.time,
//設置x軸文字傾斜顯示
axisLabel:
{
interval:0,
rotate:40,
},
//設置x軸文字長度自動適應
grid: {
left: '10%',
bottom:'35%'
}
},
yAxis: {
type: 'value',
// name: '營業(yè)額(元)',
axisTick: {
inside: true
},
scale: true,
axisLabel: {
margin: 2,
formatter: function (value, index) {
if (value <= -10000000) {
value = value / 100000000 + "億";
}
else if (value <= -10000 && value > -10000000) {
value = value / 10000 + "萬";
}
else if (value >= 10000 && value < 10000000) {
value = value / 10000 + "萬";
}
else if (value >= 10000000 && value < 100000000) {
value = value / 10000000 + "千萬";
}
else if (value > 100000000 ) {
value = value / 100000000 + "億";
}
return value;
}
}
},
series: [
{
name: '入庫總行數(shù)',
type: 'bar',
data: charData.cloudRows,
itemStyle:{
normal:{
color:'#19BE6B'
}
},
},
{
name: '源文件總行數(shù)',
type: 'bar',
data: charData.billRows,
itemStyle:{
normal:{
color:'#2D8CF0'
}
},
},
{
name: '總行數(shù)差值',
type: 'bar',
data: charData.diffRows,
itemStyle:{
normal:{
color:'#993300'
}
},
}
]
}
);
}
}
}
</script>
Vue中使用Echarts繪制柱狀圖
最后編輯于 :
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
- 文/潘曉璐 我一進店門回梧,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人祖搓,你說我怎么就攤上這事『” “怎么了拯欧?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長财骨。 經(jīng)常有香客問我镐作,道長藏姐,這世上最難降的妖魔是什么? 我笑而不...
- 正文 為了忘掉前任该贾,我火速辦了婚禮羔杨,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘杨蛋。我一直安慰自己兜材,他們只是感情好,可當我...
- 文/花漫 我一把揭開白布逞力。 她就那樣靜靜地躺著曙寡,像睡著了一般。 火紅的嫁衣襯著肌膚如雪寇荧。 梳的紋絲不亂的頭發(fā)上举庶,一...
- 文/蒼蘭香墨 我猛地睜開眼寻仗,長吁一口氣:“原來是場噩夢啊……” “哼刃泌!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起署尤,我...
- 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響喘漏,放射性物質(zhì)發(fā)生泄漏护蝶。R本人自食惡果不足惜,卻給世界環(huán)境...
- 文/蒙蒙 一翩迈、第九天 我趴在偏房一處隱蔽的房頂上張望持灰。 院中可真熱鬧,春花似錦负饲、人聲如沸堤魁。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽姨涡。三九已至,卻和暖如春吧慢,著一層夾襖步出監(jiān)牢的瞬間涛漂,已是汗流浹背。 一陣腳步聲響...
推薦閱讀更多精彩內(nèi)容
- Python自2017年在IT行業(yè)火起來之后忙菠,可謂占據(jù)了一定的地位何鸡,江湖傳言說以后可能威脅到老大哥(Java)的地...
- 加上json數(shù)據(jù)之后,動態(tài)生成 的統(tǒng)計圖 data.json數(shù)據(jù) 項目地址下載: ajax數(shù)據(jù)交互例子: 文末福利...
- 參考鏈接:echarts官網(wǎng):http://echarts.baidu.com/原型圖(效果圖): 代碼: 橫向柱...
- 午飯后,依舊在籃球場散步拾稳,七八只大小喜鵲立在護欄上喳喳叫個不停吮炕,聲音異于平日。校園里喜鵲頗多访得,大家早已習慣来屠,以為今...