2018-03-17 18:26:18 +05:30
|
|
|
<script>
|
2018-05-09 12:01:36 +05:30
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
generatedLinePath: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-05-09 12:01:36 +05:30
|
|
|
generatedAreaPath: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-05-09 12:01:36 +05:30
|
|
|
lineStyle: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
lineColor: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
areaColor: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
strokeDashArray() {
|
|
|
|
if (this.lineStyle === 'dashed') return '3, 1';
|
|
|
|
if (this.lineStyle === 'dotted') return '1, 1';
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-03-17 18:26:18 +05:30
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<g>
|
|
|
|
<path
|
|
|
|
class="metric-area"
|
|
|
|
:d="generatedAreaPath"
|
|
|
|
:fill="areaColor"
|
|
|
|
transform="translate(-5, 20)"
|
|
|
|
/>
|
|
|
|
<path
|
|
|
|
class="metric-line"
|
|
|
|
:d="generatedLinePath"
|
|
|
|
:stroke="lineColor"
|
|
|
|
fill="none"
|
|
|
|
stroke-width="1"
|
|
|
|
:stroke-dasharray="strokeDashArray"
|
|
|
|
transform="translate(-5, 20)"
|
|
|
|
/>
|
|
|
|
</g>
|
|
|
|
</template>
|