Skip to content

Commit 0f8cac9

Browse files
authored
Merge pull request #10 from zingchart/import-refactor
Import refactor
2 parents 56e097c + 92040f7 commit 0f8cac9

10 files changed

+128
-11
lines changed

ZingChart.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,10 @@ export default {
136136
width: function() { this.resize() },
137137
}
138138
};
139+
140+
// assign window level constants to local vars for export
141+
let ZC = window.ZC;
142+
143+
// export ZingChart react class, ZC and zingchart window objects
144+
export {ZC, zingchart};
139145
</script>

dist/zingchartVue.common.js

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zingchartVue.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zingchartVue.umd.js

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zingchartVue.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zingchartVue.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zingchartVue.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
<a href="#" class="button" @click="activeDemo = 'dynamic'">Dynamic Config</a>
88
<a href="#" class="button" @click="activeDemo = 'methods'">Methods</a>
99
<a href="#" class="button" @click="activeDemo = 'events'">Events</a>
10+
<a href="#" class="button" @click="activeDemo = 'license'">License</a>
1011
</header>
1112
<simple-view v-show="activeDemo === 'simple'"/>
1213
<dynamic-view v-show="activeDemo === 'dynamic'"/>
1314
<methods-view v-show="activeDemo === 'methods'"/>
1415
<events-view v-show="activeDemo === 'events'"/>
16+
<license-view v-show="activeDemo === 'license'"/>
1517
</div>
1618
</template>
1719

@@ -22,6 +24,9 @@ import MethodsView from './Methods.vue';
2224
import EventsView from './Events.vue';
2325
import DynamicView from './Dynamic.vue';
2426
import SimpleView from './Simple.vue';
27+
import LicenseView from './License.vue';
28+
29+
2530
Vue.component('zingchart', zingchartVue);
2631
2732
export default {
@@ -30,6 +35,7 @@ export default {
3035
DynamicView,
3136
MethodsView,
3237
EventsView,
38+
LicenseView,
3339
},
3440
data() {
3541
return {

examples/License.vue

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<template>
2+
<div>
3+
<h3>A graphset example with ZC and zingchart objects.</h3>
4+
<zingchart ref="chart" :data="chartData" />
5+
<pre>
6+
&lt;zingchart ref="chart" :data="chartData"/&gt;
7+
</pre>
8+
<pre>
9+
chartData: {
10+
type: "line",
11+
series: [
12+
{
13+
values: [6,4,3,4,6,6,4]
14+
}
15+
]
16+
},
17+
</pre>
18+
</div>
19+
</template>
20+
21+
<script>
22+
import {ZC, zingchart} from '../ZingChart.vue';
23+
24+
// zingchart object for performance flags
25+
zingchart.DEV.KEEPSOURCE = 0; // prevents lib from storing the original data package
26+
zingchart.DEV.COPYDATA = 0; // prevents lib from creating a copy of the data package
27+
28+
// ZC object for license key
29+
ZC.LICENSEKEY = ['abcdefghijklmnopqrstuvwxy'];
30+
31+
32+
export default {
33+
data() {
34+
return {
35+
chartData: {
36+
/* Graphset array */
37+
graphset: [
38+
{ /* Object containing chart data */
39+
type: 'line',
40+
/* Size your chart using height/width attributes */
41+
height: '200px',
42+
width: '100%',
43+
/* Position your chart using x/y attributes */
44+
x: '5%',
45+
y: '5%',
46+
series:[
47+
{
48+
values:[76,23,15,85,13]
49+
},
50+
{
51+
values:[36,53,65,25,45]
52+
}
53+
]
54+
},
55+
{ /* Object containing chart data */
56+
type: 'funnel',
57+
height: '55%',
58+
width: '50%',
59+
x: '5%',
60+
y: '200px',
61+
series:[
62+
{values:[30]},
63+
{values:[15]},
64+
{values:[5]},
65+
{values:[3]}
66+
]
67+
},
68+
{
69+
type: 'pie',
70+
height: '55%',
71+
width: '50%',
72+
x: '50%',
73+
y: '200px',
74+
series:[
75+
{values:[15]},
76+
{values:[30]},
77+
{values:[34]}
78+
]
79+
}
80+
]
81+
},
82+
}
83+
}
84+
}
85+
</script>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zingchart-vue",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "ZingChart Vue Component wrapper to allow native vue syntax for javascript charts, chart events, chart methods and chart styling.",
55
"author": "ZingSoft Inc",
66
"scripts": {

0 commit comments

Comments
 (0)