some modify

This commit is contained in:
jiaming 2018-12-16 17:57:34 +08:00
parent 3c60ecf02f
commit 4c2d8e2cdf
2 changed files with 296 additions and 52 deletions

View File

@ -1,42 +1,142 @@
<template> <template>
<div id="chart"> <div id="chart">
<border-box-7 class="attention">
<div class="title">Attention</div>
<div class="text-info">
下列组件颜色配置均绑定在节点的colors属性上
</div>
<div class="text-info">
若未绑定将自动使用默认配色
</div>
<div class="text-info">
colors所绑变量应为hex十六进制色的数组,示例如下
</div>
<highlight-code>
&lt;chart :data="data" :colors="color" /&gt;
</highlight-code>
<highlight-code>
// ./src/config/color.js
colors: ['#9cf4a7', '#66d7ee', '#eee966', '#a866ee', '#ee8f66', '#ee66aa']
// 使
</highlight-code>
<div class="text-info">
如在特殊颜色配置属性中使用colors关键字,将自动将该属性配置指向colors
</div>
<div class="text-info">
下列组件均不再展示colors属性绑定的变量
</div>
</border-box-7>
<border-box-7 class="chart-item"> <border-box-7 class="chart-item">
<radar-chart :data="radarChartData" :colors="colors" class="chart" /> <radar-chart :data="radarChartData1" :colors="colors" class="chart" />
<div class="config-info"> <div class="config-info">
<div class="title">Radar-Chart</div> <div class="title">Radar-Chart</div>
<highlight-code> <highlight-code>
&lt;radar-chart :data="data" :colors="color" /&gt; &lt;radar-chart :data="data" :colors="colors" /&gt;
</highlight-code> </highlight-code>
<highlight-code> <highlight-code>
data: { data: {
//
data: [ data: [
{ {
// data: [450, 50, 450, 50, 450, 50] //
data: [180, 250, 300, 500, 600]
// 线
// color: '#f92655',
// 线线
dashed: true
}, },
{ {
data: [210, 330, 450, 261, 448] data: [50, 450, 50, 450, 50, 450]
}, ... }, ...
], ],
label: { label: {
// data: ['西峡', '周口', '南阳', '驻马店', '郑州', '洛阳'] //
data: ['石家庄', '周口', '南阳', '驻马店', '郑州'], },
// label labelLine: ['同期', '环期'] // label
// color: '#fff' }
</highlight-code>
</div>
</border-box-7>
<border-box-7 class="chart-item">
<radar-chart :data="radarChartData2" :colors="colors" class="chart" />
<div class="config-info">
<div class="title">Radar-Chart</div>
<highlight-code>
&lt;radar-chart :data="data" :colors="colors" /&gt;
</highlight-code>
<highlight-code>
data: {
data: [
{
data: [450, 50, 450, 50, 450, 50],
dashed: true // 线
},
{
data: [50, 450, 50, 450, 50, 450],
lineColor: '#9cf4df', // 线
fillColor: 'rgba(238, 233, 108, 0.5)' //
}
],
label: {
data: ['西峡', '周口', '南阳', '驻马店', '郑州', '洛阳'],
color: 'colors', //
fontSize: 10 //
}, },
// label
labelLine: ['同期', '环期'], labelLine: ['同期', '环期'],
// rayLineType: 'dashed', // 线线
// radius: 0.8, rayLineColor: 'colors', // 线
// ringNum: 5, // 线
// circleNum: 6 ringType: 'polyline', // 线线
ringFillType: 'cover', // 线cover
ringFillColor: ['rgba(61, 231, 201, 0.3)', 'rgba(61, 231, 201, 0.1)'], // 线
ringLineType: 'line', // 线线线
ringLineColor: 'rgba(156, 244, 233, 0.2)', // 线线
rayLineOffset: Math.PI * -1.5, //
radius: 0.8, // 线
max: 550 //
}
</highlight-code>
</div>
</border-box-7>
<border-box-7 class="chart-item">
<radar-chart :data="radarChartData3" :colors="colors" class="chart" />
<div class="config-info">
<div class="title">Radar-Chart</div>
<highlight-code>
&lt;radar-chart :data="data" :colors="colors" /&gt;
</highlight-code>
<highlight-code>
data: {
//
ringFillType: 'mulCover', // 线mulCover
}
</highlight-code>
</div>
</border-box-7>
<border-box-7 class="chart-item">
<radar-chart :data="radarChartData4" :colors="colors" class="chart" />
<div class="config-info">
<div class="title">Radar-Chart</div>
<highlight-code>
&lt;radar-chart :data="data" :colors="colors" /&gt;
</highlight-code>
<highlight-code>
data: {
//
ringFillType: 'ring', // 线ring
} }
</highlight-code> </highlight-code>
</div> </div>
@ -374,6 +474,108 @@ export default {
name: 'Chart', name: 'Chart',
data () { data () {
return { return {
radarChartData1: {
data: [
{
data: [450, 50, 450, 50, 450, 50]
},
{
data: [50, 450, 50, 450, 50, 450]
}
],
label: {
data: ['西峡', '周口', '南阳', '驻马店', '郑州', '洛阳']
},
labelLine: ['同期', '环期']
},
radarChartData2: {
data: [
{
data: [450, 50, 450, 50, 450, 50],
dashed: true
},
{
data: [50, 450, 50, 450, 50, 450],
lineColor: '#9cf4df',
fillColor: 'rgba(238, 233, 108, 0.5)'
}
],
label: {
data: ['西峡', '周口', '南阳', '驻马店', '郑州', '洛阳'],
color: 'colors',
fontSize: 10
},
labelLine: ['同期', '环期'],
rayLineType: 'dashed',
rayLineColor: 'colors',
ringNum: 5,
ringType: 'polyline',
ringFillType: 'cover',
ringFillColor: ['rgba(61, 231, 201, 0.3)', 'rgba(61, 231, 201, 0.1)'],
ringLineType: 'line',
ringLineColor: 'rgba(156, 244, 233, 0.2)',
rayLineOffset: Math.PI * -1.5,
radius: 0.8,
max: 550
},
radarChartData3: {
data: [
{
data: [450, 50, 450, 50, 450, 50]
},
{
data: [50, 450, 50, 450, 50, 450]
}
],
label: {
data: ['西峡', '周口', '南阳', '驻马店', '郑州', '洛阳'],
color: 'colors',
fontSize: 10
},
labelLine: ['同期', '环期'],
rayLineType: 'dashed',
rayLineColor: 'colors',
ringNum: 5,
ringType: 'polyline',
ringFillType: 'mulCover',
ringFillColor: ['rgba(61, 231, 201, 0.1)'],
ringLineType: 'line',
ringLineColor: 'rgba(156, 244, 233, 0.2)',
rayLineOffset: Math.PI * -1.5,
radius: 0.8,
max: 550
},
radarChartData4: {
data: [
{
data: [450, 50, 450, 50, 450, 50]
},
{
data: [50, 450, 50, 450, 50, 450]
}
],
label: {
data: ['西峡', '周口', '南阳', '驻马店', '郑州', '洛阳'],
color: 'colors',
fontSize: 10
},
labelLine: ['同期', '环期'],
rayLineType: 'dashed',
rayLineColor: 'colors',
ringNum: 5,
ringType: 'polyline',
ringFillType: 'ring',
ringFillColor: ['rgba(61, 231, 201, 0.3)', 'rgba(61, 231, 201, 0.1)'],
ringLineType: 'line',
ringLineColor: 'rgba(156, 244, 233, 0.2)',
rayLineOffset: Math.PI * -1.5,
radius: 0.8,
max: 550
},
capsuleChartData: { capsuleChartData: {
data: [ data: [
{ {
@ -654,35 +856,6 @@ export default {
boundaryGap: true boundaryGap: true
}, },
radarChartData: {
data: [
{
data: [180, 250, 300, 500, 600],
dashed: true
},
{
data: [210, 330, 450, 261, 299]
}
],
label: {
data: ['石家庄', '周口', '南阳', '驻马店', '郑州'],
color: 'colors',
fontSize: 12
},
labelLine: ['同期', '环期'],
ringLineColor: '#43ffff',
ringType: 'polyline',
// radius: 2,
ringFillType: 'ring',
// ringFillColor: 'rgba(61, 231, 201, 0.1)',
rayLineType: 'dashed',
ringFillColor: ['rgba(61, 231, 201, 0.3)', 'rgba(61, 231, 201, 0.1)']
// ringNum: 5
// ringLineType: 'line'
// rayLineOffset: Math.PI * 1
},
// colors: ['#00baff', '#3de7c9']
colors: '' colors: ''
} }
} }
@ -694,6 +867,16 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.attention {
width: 80%;
margin-left: 20%;
text-align: center;
.highlight-code {
margin: -40px 0px;
}
}
.chart-item { .chart-item {
width: 80%; width: 80%;
min-height: 300px; min-height: 300px;

View File

@ -1,18 +1,79 @@
<template> <template>
<div id="table"> <div id="other">
this is table <border-box-7 class="other-item">
<div class="component">
<percent-pond :percent="66" />
</div>
<div class="config-info">
<div class="title">Percent-Pond</div>
<highlight-code>
&lt;percent-pond :percent="1399" /&gt;
</highlight-code>
</div>
</border-box-7>
<border-box-7 class="other-item">
<div class="component">
<number-show :number="1399" />
</div>
<div class="config-info">
<div class="title">Number-Show</div>
<highlight-code>
&lt;number-show :number="1399" /&gt;
</highlight-code>
</div>
</border-box-7>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Table' name: 'Other'
} }
</script> </script>
<style lang="less"> <style lang="less">
#table { #other {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex;
flex-direction: column;
.other-item {
width: 80%;
margin-left: 20%;
min-height: 300px;
align-items: center;
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 20px;
}
.component {
width: 400px;
display: flex;
flex-direction: row;
justify-content: center;
}
.config-info {
padding: 0px 30px;
display: flex;
flex-direction: column;
.highlight-code {
margin: -30px 0px;
}
}
.percent-pond {
width: 300px;
height: 80px;
}
} }
</style> </style>