update dist and lib

This commit is contained in:
jiaming743 2020-05-06 14:15:15 +08:00
parent 8e5f279b6e
commit 6ce83e1fd8
5 changed files with 937 additions and 960 deletions

1837
dist/datav.map.vue.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -96,11 +96,11 @@ export default {
*/
animationFrame: 50,
/**
* @description CRender showOriginalValue
* @description showOriginValue
* @type {Boolean}
* @default showOriginalValue = false
* @default showOriginValue = false
*/
showOriginalValue: false
showOriginValue: false
},
mergedConfig: null,
@ -122,14 +122,14 @@ export default {
digitalFlopStyle,
digitalFlopToFixed,
data,
showOriginalValue
showOriginValue
} = mergedConfig
const value = data.map(({ value }) => value)
let displayValue
if (showOriginalValue) {
if (showOriginValue) {
displayValue = value[activeIndex]
} else {
const sum = value.reduce((all, v) => all + v, 0)
@ -140,7 +140,7 @@ export default {
}
return {
content: showOriginalValue ? '{nt}' : '{nt}%',
content: showOriginValue ? '{nt}' : '{nt}%',
number: [displayValue],
style: digitalFlopStyle,
toFixed: digitalFlopToFixed

View File

@ -31,28 +31,27 @@
margin: 5px 0px;
border-radius: 5px;
}
.dv-capsule-chart .capsule-item div {
.dv-capsule-chart .capsule-item .capsule-item-column {
position: relative;
height: 8px;
margin-top: 1px;
border-radius: 5px;
transition: all 0.3s;
display: flex;
justify-content: flex-end;
align-items: center;
}
.dv-capsule-chart .capsule-item div .capsule-item-val {
position: absolute;
top: -5px;
.dv-capsule-chart .capsule-item .capsule-item-column .capsule-item-value {
font-size: 12px;
transform: translateX(100%);
}
.dv-capsule-chart .unit-label {
height: 20px;
font-size: 12px;
position: relative;
}
.dv-capsule-chart .unit-label:not(:first-child) {
text-align: right;
}
.dv-capsule-chart .unit-label div {
position: absolute;
display: flex;
justify-content: space-between;
align-items: center;
}
.dv-capsule-chart .unit-text {
text-align: right;

View File

@ -9,13 +9,13 @@
<div class="capsule-container">
<div class="capsule-item" v-for="(capsule, index) in capsuleLength" :key="index">
<div
class="capsule-item-column"
:style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"
>
<span
v-if="mergedConfig.showVal"
class="capsule-item-val"
:style="`right:-${`${capsuleValue[index]}`.length * 7}px`"
>{{ capsuleValue[index] }}</span>
<div
v-if="mergedConfig.showValue"
class="capsule-item-value"
>{{ capsuleValue[index] }}</div>
</div>
</div>
@ -23,7 +23,6 @@
<div
v-for="(label, index) in labelData"
:key="label + index"
:style="calcUnitLabelStyle(index)"
>{{ label }}</div>
</div>
</div>
@ -77,7 +76,12 @@ export default {
* @default unit = ''
*/
unit: '',
showVal: false
/**
* @description Show item value
* @type {Boolean}
* @default showValue = false
*/
showValue: false
},
mergedConfig: null,
@ -135,15 +139,6 @@ export default {
this.labelDataLength = Array.from(labelData).map(v =>
maxValue ? v / maxValue : 0
)
},
/**
* 计算x轴label位置
*/
calcUnitLabelStyle(index) {
if (this.labelData.length - 1 === index) {
return `right: 0;`
}
return `left: ${this.labelDataLength[index] * 100}%;`
}
},
mounted() {