Skip to content

Commit 143c2d9

Browse files
committed
fix: added chart wrappers + cosmetic changes
1 parent 44a6c93 commit 143c2d9

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

src/mixins/charts/chartMixins.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { deepObjectsMerge } from '@coreui/coreui/dist/js/coreui-utilities'
2-
import getColor from '@coreui/coreui/js/src/utilities/get-color'
1+
import { deepObjectsMerge, getColor } from '@coreui/coreui/dist/js/coreui-utilities'
32

43
const generatedLabels = {
54
computed:{

src/views/Dashboard.vue

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<template slot='chart'>
1818
<line-chart2 chartId="widget06_1" slot='chart' class='px-3' :data='[65, 59, 84, 84, 51, 55, 40]'
1919
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
20-
style='height:70px' label='Members'/>
20+
style='height:70px' label='Members' pointHoverBackgroundColor='primary'/>
2121
</template>
2222
</widget06>
2323
</b-col>
@@ -35,9 +35,10 @@
3535
</b-dropdown>
3636
</template>
3737
<template slot='chart'>
38-
<line-chart2 chartId="widget06_2" slot='chart' class='px-3' :data='[1, 18, 9, 17, 34, 22, 11]'
38+
<line-chart2 chartId='widget06_2' slot='chart' class='px-3' :data='[1, 18, 9, 17, 34, 22, 11]'
3939
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
40-
style='height:70px' label='Members'/>
40+
style='height:70px' label='Members' :options='{elements: {line: {tension: 0.00001}}}'
41+
pointHoverBackgroundColor='info'/>
4142
</template>
4243
</widget06>
4344
</b-col>
@@ -57,7 +58,8 @@
5758
<template slot='chart'>
5859
<line-chart1 chartId="widget06_3" slot='chart' :data='[78, 81, 80, 45, 34, 12, 40]'
5960
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
60-
style='height:70px' backgroundColor ='rgba(255,255,255,.2)' label='Members'/>
61+
style='height:70px' backgroundColor ='rgba(255,255,255,.2)' label='Members'
62+
:options="{elements: {line: {borderWidth: 2.5}}}" pointHoverBackgroundColor='warning'/>
6163
</template>
6264
</widget06>
6365
</b-col>
@@ -76,7 +78,7 @@
7678
</template>
7779
<template name='chart'>
7880
<bar-chart1 chartId="widget06_4" slot='chart' :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
79-
label='Members' backgroundColor='rgb(250, 152, 152)' style='height:70px'/>
81+
label='Members' backgroundColor='rgb(250, 152, 152)' style='height:70px' />
8082
</template>
8183
</widget06>
8284
</b-col>
@@ -132,25 +134,29 @@
132134
<b-row>
133135
<b-col md="3" sm="6">
134136
<widget04 type="facebook" rightHeader="89k" rightFooter="friends" leftHeader="459" leftFooter="feeds">
135-
<line-chart1 chartId="facebook" :data='[0, 22, 34, 46, 58, 70, 68, 58, 52, 60, 64, 70]' label='Friends'
137+
<line-chart1 chartId="facebook" :data='[65, 59, 84, 84, 51, 55, 40]' label='Friends'
138+
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
136139
style='height:100px' backgroundColor='rgba(255,255,255,.1)'/>
137140
</widget04>
138141
</b-col>
139142
<b-col md="3" sm="6">
140143
<widget04 type="twitter" rightHeader="973k" rightFooter="followers" leftHeader="1.792" leftFooter="tweets">
141-
<line-chart1 chartId="twitter" :data='[5, 22, 34, 46, 58, 70, 68, 58, 52, 60, 64, 72]' label='Followers'
144+
<line-chart1 chartId="twitter" :data='[1, 13, 9, 17, 34, 41, 38]' label='Followers'
145+
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
142146
style='height:100px' backgroundColor='rgba(255,255,255,.1)'/>
143147
</widget04>
144148
</b-col>
145149
<b-col md="3" sm="6">
146150
<widget04 type="linkedin" rightHeader="500+" rightFooter="contracts" leftHeader="292" leftFooter="feeds">
147-
<line-chart1 chartId="linkedIn" :data='[15, 22, 34, 46, 58, 70, 68, 58, 52, 60, 64, 71]' label='Contracts'
151+
<line-chart1 chartId="linkedIn" :data='[78, 81, 80, 45, 34, 12, 40]' label='Contracts'
152+
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
148153
style='height:100px' backgroundColor='rgba(255,255,255,.1)'/>
149154
</widget04>
150155
</b-col>
151156
<b-col md="3" sm="6">
152157
<widget04 type='google-plus' rightHeader='894' rightFooter='followers' leftHeader='92' leftFooter='circles'>
153-
<line-chart1 chartId="google-plus" :data='[10, 22, 34, 46, 58, 70, 68, 58, 52, 60, 64, 74]' label='Followers'
158+
<line-chart1 chartId="google-plus" :data='[35, 23, 56, 22, 97, 23, 64]' label='Followers'
159+
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
154160
style='height:100px' backgroundColor='rgba(255,255,255,.1)'/>
155161
</widget04>
156162
</b-col>

src/views/widgets/Widget06.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<h4 class="mb-0">{{header}}</h4>
66
<p>{{text}}</p>
77
</b-card-body>
8-
<slot name='chart'></slot>
8+
<div class="chart-wrapper">
9+
<slot name='chart'></slot>
10+
</div>
911
</b-card>
1012
</template>
1113

src/views/widgets/Widget07.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
<small>{{leftFooter}}</small>
1414
</span>
1515
</div>
16-
<slot></slot>
16+
<div class="chart-wrapper">
17+
<slot></slot>
18+
</div>
1719
</div>
1820
</div>
1921
</template>

src/views/widgets/Widget08.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<div class="card-body text-center">
44
<div class="text-muted small text-uppercase font-weight-bold">{{header}}</div>
55
<div class="h2 py-3">{{text}}</div>
6-
<!-- <div class="chart-wrapper"> -->
6+
<div class="chart-wrapper">
77
<slot></slot>
8-
<!-- </div> -->
8+
</div>
99
</div>
1010
</div>
1111
</template>

0 commit comments

Comments
 (0)