Commit d7b9cc39 authored by Jenny's avatar Jenny

feat: 图表组件尺寸

parent 2941eec4
......@@ -6,6 +6,7 @@
ref="barMixMapCanvas"
canvas-id="bar-mix-map-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="chinaMapCanvas"
canvas-id="china-map-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="horizontalBarCanvas"
canvas-id="horizontal-bar-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="lineMixBarCanvas"
canvas-id="line-mix-bar-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="normalbarCanvas"
canvas-id="normal-bar-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="normalGaugeCanvas"
canvas-id="normal-gauge-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="normalLineCanvas"
canvas-id="normal-line-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -6,6 +6,7 @@
ref="normalPieCanvas"
canvas-id="normal-pie-chart"
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -5,7 +5,9 @@
id="normalra-dar"
ref="normalRadarCanvas"
canvas-id="normalra-dar-chart"
:ec="ec"></uni-ec-canvas>
:ec="ec"
:style="[elStyleObject]"
></uni-ec-canvas>
</view>
</template>
......
......@@ -11,6 +11,16 @@ export default {
required: true
}
},
computed: {
elStyleObject() {
const { windowWidth } = uni.getSystemInfoSync()
const { width, height } = this.elementInfo
return {
'width': `${width > windowWidth ? '100%' : width + 'px'}`,
'height': `${width > windowWidth ? height / width * windowWidth : height}px`
}
}
},
methods: {
/**
* 静态数据
......
......@@ -26,4 +26,5 @@
width: 100%;
height: 750rpx;
display:block;
margin: 20rpx auto;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment