File tree Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Expand file tree Collapse file tree 3 files changed +39
-4
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
+ >
22
28
FusionCharts will render here...
23
29
</ fusioncharts >
24
30
< div v-show ="displayChart ">
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' ,
@@ -95,9 +105,9 @@ var chart = new Vue({
95
105
methods : {
96
106
changeFirstChartAttr : function ( ) {
97
107
// 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();
108
+ this . chartDs . chart . caption = 'Changed to something else' ;
109
+ this . chartDs . data [ 2 ] . value = this . getRandomNumber ( ) ;
110
+ this . chartDs . data [ 1 ] . value = this . getRandomNumber ( ) ;
101
111
// this.pieDataSource = dataSource;
102
112
} ,
103
113
changeSecondChartAttr : function ( ) {
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ export default (FC, ...options) => {
124
124
} ,
125
125
dataSource : {
126
126
handler : function ( ) {
127
+ console . log ( 'Called dataSource' ) ;
127
128
if ( ! checkIfDataTableExists ( this . dataSource ) ) {
128
129
this . chartObj . setChartData (
129
130
this . datasource || this . dataSource ,
@@ -143,6 +144,24 @@ export default (FC, ...options) => {
143
144
}
144
145
} ,
145
146
deep : true
147
+ } ,
148
+ 'datasource.data' : {
149
+ handler : function ( ) {
150
+ this . chartObj . setChartData (
151
+ this . datasource || this . dataSource ,
152
+ this . dataFormat || this . dataformat
153
+ ) ;
154
+ } ,
155
+ deep : false
156
+ } ,
157
+ 'dataSource.data' : {
158
+ handler : function ( ) {
159
+ this . chartObj . setChartData (
160
+ this . datasource || this . dataSource ,
161
+ this . dataFormat || this . dataformat
162
+ ) ;
163
+ } ,
164
+ deep : false
146
165
}
147
166
} ,
148
167
deactivated : function ( ) {
You can’t perform that action at this time.
0 commit comments