File tree Expand file tree Collapse file tree 3 files changed +48
-18
lines changed Expand file tree Collapse file tree 3 files changed +48
-18
lines changed Original file line number Diff line number Diff line change 18
18
19
19
< body >
20
20
< div id ="chart1 ">
21
- < fusioncharts :options ="options ">
21
+ < fusioncharts
22
+ :width ="width "
23
+ :height ="height "
24
+ :type ="pieType "
25
+ :dataFormat ="dataFormat "
26
+ :dataSource ="chartDs "
27
+ >
28
+ FusionCharts will render here...
29
+ </ fusioncharts >
30
+ < fusioncharts
31
+ :width ="width "
32
+ :height ="height "
33
+ :type ="type "
34
+ :dataFormat ="dataFormat "
35
+ :dataSource ="dataSource "
36
+ >
22
37
FusionCharts will render here...
23
38
</ fusioncharts >
24
- < div v-show ="displayChart ">
25
- < fusioncharts
26
- :width ="width "
27
- :height ="height "
28
- :type ="type "
29
- :dataFormat ="dataFormat "
30
- :dataSource ="dataSource "
31
- >
32
- FusionCharts will render here...
33
- </ fusioncharts >
34
- </ div >
35
39
< button @click ="changeFirstChartAttr "> Change 1st Chart Attributes</ button >
36
40
< button @click ="changeSecondChartAttr ">
37
41
Change 2nd Chart Attributes
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ var chart = new Vue({
58
58
}
59
59
]
60
60
} ,
61
+ pieType : 'Pie2D' ,
62
+ chartDs : {
63
+ chart : {
64
+ caption : 'Vue FusionCharts Sample' ,
65
+ theme : 'fint' ,
66
+ animation : '1' ,
67
+ updateanimduration : '100'
68
+ } ,
69
+ data : [ { value : 1.9 } , { value : 2.3 } , { value : 2.1 } ]
70
+ } ,
61
71
options : {
62
72
width : '500' ,
63
73
height : '300' ,
@@ -89,15 +99,14 @@ var chart = new Vue({
89
99
}
90
100
]
91
101
}
92
- } ,
93
- displayChart : false
102
+ }
94
103
} ,
95
104
methods : {
96
105
changeFirstChartAttr : function ( ) {
97
106
// let dataSource = Object.assign({}, this.pieDataSource);
98
- this . options . dataSource . chart . caption = 'Changed to something else' ;
99
- // dataSource .data[2].value = this.getRandomNumber();
100
- // dataSource .data[1].value = this.getRandomNumber();
107
+ this . chartDs . chart . caption = 'Changed to something else' ;
108
+ this . chartDs . data [ 2 ] . value = this . getRandomNumber ( ) ;
109
+ this . chartDs . data [ 1 ] . value = this . getRandomNumber ( ) ;
101
110
// this.pieDataSource = dataSource;
102
111
} ,
103
112
changeSecondChartAttr : function ( ) {
@@ -120,7 +129,6 @@ var chart = new Vue({
120
129
schema
121
130
) ;
122
131
this . dataSource . data = fusionTable ;
123
- this . displayChart = true ;
124
132
} ) ;
125
133
}
126
134
} ) ;
Original file line number Diff line number Diff line change @@ -143,6 +143,24 @@ export default (FC, ...options) => {
143
143
}
144
144
} ,
145
145
deep : true
146
+ } ,
147
+ 'datasource.data' : {
148
+ handler : function ( ) {
149
+ this . chartObj . setChartData (
150
+ this . datasource || this . dataSource ,
151
+ this . dataFormat || this . dataformat
152
+ ) ;
153
+ } ,
154
+ deep : false
155
+ } ,
156
+ 'dataSource.data' : {
157
+ handler : function ( ) {
158
+ this . chartObj . setChartData (
159
+ this . datasource || this . dataSource ,
160
+ this . dataFormat || this . dataformat
161
+ ) ;
162
+ } ,
163
+ deep : false
146
164
}
147
165
} ,
148
166
deactivated : function ( ) {
You can’t perform that action at this time.
0 commit comments