Skip to content

Commit 6260de1

Browse files
committed
Fixed timeseries bug for initial rendering
1 parent 15a2236 commit 6260de1

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

example/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818

1919
<body>
2020
<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+
>
2228
FusionCharts will render here...
2329
</fusioncharts>
2430
<div v-show="displayChart">

example/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ var chart = new Vue({
5858
}
5959
]
6060
},
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+
},
6171
options: {
6272
width: '500',
6373
height: '300',
@@ -95,9 +105,9 @@ var chart = new Vue({
95105
methods: {
96106
changeFirstChartAttr: function() {
97107
// 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();
101111
// this.pieDataSource = dataSource;
102112
},
103113
changeSecondChartAttr: function() {

src/vue-fusioncharts-component.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export default (FC, ...options) => {
124124
},
125125
dataSource: {
126126
handler: function() {
127+
console.log('Called dataSource');
127128
if (!checkIfDataTableExists(this.dataSource)) {
128129
this.chartObj.setChartData(
129130
this.datasource || this.dataSource,
@@ -143,6 +144,24 @@ export default (FC, ...options) => {
143144
}
144145
},
145146
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
146165
}
147166
},
148167
deactivated: function() {

0 commit comments

Comments
 (0)