123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <view class="chart-container">
- <view class="chart-name">
- <text class="chart-name-text">成绩目标</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="bar" :chartData="chartData" :loadingType="4" background="none" />
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "bar-chart",
- data() {
- return {
- chartData: {
- categories: [
- "数学",
- "语文",
- "英语",
- "体育",
- "科学",
- "思品"
- ],
- series: [{
- "name": "目标成绩",
- "data": [
- 97,
- 90,
- 100,
- 95,
- 97,
- 91
- ]
- },
- {
- "name": "近期成绩",
- "data": [
- 91,
- 92,
- 94,
- 88,
- 82,
- 89
- ]
- }
- ],
- },
- };
- },
- methods:{
-
- }
- }
- </script>
- <style lang="scss">
- .chart-container {
- margin: 10px;
- padding: 5px 5px 5px 3px;
- border-radius: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 3px 3px 5px 1px rgba(0, 0, 0, 0.05);
- .chart-name {
- width: 100%;
- text-align: left;
- margin-left: 18px;
- margin-top: 8px;
- .chart-name-text {
- font-size: 13px;
- }
- }
- /* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */
- .charts-box {
- width: 100%;
- height: 280px;
- }
- }
- </style>
|