55 <div class =" container container-1200 info-wrapper" >
66 <!-- <router-view></router-view> -->
77 <!-- Chart selection for mobile devices - start -->
8+ <div class =" row" >
9+ <div class =" col-12 d-flex justify-content-center d-md-none" >
10+ <div id =" mobileChart-selector" class =" base-dropdown chart-selector" >
11+ <div class =" selector" @click =" toggleModal(true)" >{{selectedTitle}}</div >
12+ <div class =" placeholder" >Quick Demo:</div >
13+ <div class =" caret" >
14+ <i class =" fc_dropdown" ></i >
15+ </div >
16+ </div >
17+ </div >
18+ </div >
19+ <!-- Modal for selection (Only for Mobile Devices) -->
20+ <div
21+ id =" myModal"
22+ class =" modal"
23+ style =" z-index : 100 ;"
24+ v-bind:class =" getModalClass()"
25+ v-bind:style =" getModalStyle()"
26+ >
27+ <!-- Modal content -->
28+ <div class =" modal-content" >
29+ <div class =" nav-list" >
30+ <div
31+ class =" nav-item"
32+ v-bind:class =" sampleCode['ex1'].title === selectedTitle ? 'selected' : ''"
33+ >
34+ <div class =" p" @click =" openPage(1)" >{{sampleCode['ex1'].title}}</div >
35+ </div >
36+ <div
37+ class =" nav-item"
38+ v-bind:class =" sampleCode['ex2'].title === selectedTitle ? 'selected' : ''"
39+ >
40+ <div class =" p" @click =" openPage(2)" >{{sampleCode['ex2'].title}}</div >
41+ </div >
42+ <div
43+ class =" nav-item"
44+ v-bind:class =" sampleCode['ex3'].title === selectedTitle ? 'selected' : ''"
45+ >
46+ <div class =" p" @click =" openPage(3)" >{{sampleCode['ex3'].title}}</div >
47+ </div >
48+ <div
49+ class =" nav-item"
50+ v-bind:class =" sampleCode['ex4'].title === selectedTitle ? 'selected' : ''"
51+ >
52+ <div class =" p" @click =" openPage(4)" >{{sampleCode['ex4'].title}}</div >
53+ </div >
54+ <div
55+ class =" nav-item"
56+ v-bind:class =" sampleCode['ex5'].title === selectedTitle ? 'selected' : ''"
57+ >
58+ <div class =" p" @click =" openPage(5)" >{{sampleCode['ex5'].title}}</div >
59+ </div >
60+ <div
61+ class =" nav-item"
62+ v-bind:class =" sampleCode['ex6'].title === selectedTitle ? 'selected' : ''"
63+ >
64+ <div class =" p" @click =" openPage(6)" >{{sampleCode['ex6'].title}}</div >
65+ </div >
66+ <div
67+ class =" nav-item"
68+ v-bind:class =" sampleCode['ex7'].title === selectedTitle ? 'selected' : ''"
69+ >
70+ <div class =" p" @click =" openPage(7)" >{{sampleCode['ex7'].title}}</div >
71+ </div >
72+ <div
73+ class =" nav-item"
74+ v-bind:class =" sampleCode['ex8'].title === selectedTitle ? 'selected' : ''"
75+ >
76+ <div class =" p" @click =" openPage(8)" >{{sampleCode['ex8'].title}}</div >
77+ </div >
78+ </div >
79+ </div >
80+ </div >
881 <div class =" row" >
982 <div class =" side-nav col-3 d-none d-md-block" >
1083 <div class =" nav-heading" >Quick Demo:</div >
1184 <!-- Demo List -->
1285 <div class =" nav-list demo-list" >
13- <router-link to =" /column_2d " >
86+ <router-link to =" /a_simple_chart " >
1487 <a >
1588 <div v-bind:class =" getClassColumn()" >
1689 <div class =" h5" >{{sampleCode['ex1'].title}}</div >
1790 <div class =" p item-desc" >{{sampleCode['ex1'].description}}</div >
1891 </div >
1992 </a >
2093 </router-link >
21- <router-link to =" /3d_pie_chart " >
94+ <router-link to =" /a_3d_pie_chart " >
2295 <a >
2396 <div v-bind:class =" getClassPie()" >
2497 <div class =" h5" >{{sampleCode['ex2'].title}}</div >
34107 </div >
35108 </a >
36109 </router-link >
37- <router-link to =" /listen_events_chart " >
110+ <router-link to =" /listen_to_events_from_chart " >
38111 <a >
39112 <div v-bind:class =" getClassListenEvents()" >
40113 <div class =" h5" >{{sampleCode['ex4'].title}}</div >
41114 <div class =" p item-desc" >{{sampleCode['ex4'].description}}</div >
42115 </div >
43116 </a >
44117 </router-link >
45- <router-link to =" /drill_down " >
118+ <router-link to =" /add_drill_down_to_chart " >
46119 <a >
47120 <div v-bind:class =" getClassDrillDown()" >
48121 <div class =" h5" >{{sampleCode['ex5'].title}}</div >
49122 <div class =" p item-desc" >{{sampleCode['ex5'].description}}</div >
50123 </div >
51124 </a >
52125 </router-link >
53- <router-link to =" /gauge " >
126+ <router-link to =" /a_simple_gauge " >
54127 <a >
55128 <div v-bind:class =" getClassGauge()" >
56129 <div class =" h5" >{{sampleCode['ex6'].title}}</div >
57130 <div class =" p item-desc" >{{sampleCode['ex6'].description}}</div >
58131 </div >
59132 </a >
60133 </router-link >
61- <router-link to =" /theme " >
134+ <router-link to =" /applying_a_different_theme " >
62135 <a >
63136 <div v-bind:class =" getClassTheme()" >
64137 <div class =" h5" >{{sampleCode['ex7'].title}}</div >
65138 <div class =" p item-desc" >{{sampleCode['ex7'].description}}</div >
66139 </div >
67140 </a >
68141 </router-link >
69- <router-link to =" /change_type_runtime " >
142+ <router-link to =" /change_chart_type_at_runtime " >
70143 <a >
71144 <div v-bind:class =" getClassChangeType()" >
72145 <div class =" h5" >{{sampleCode['ex8'].title}}</div >
76149 </router-link >
77150 </div >
78151 </div >
79- <div class =" col-md-9 col-12" ng-controller = " DemoController " >
152+ <div class =" col-md-9 col-12" >
80153 <router-view ></router-view >
81154 </div >
82155 </div >
@@ -90,17 +163,26 @@ export default {
90163 name: ' DemoSectionComponent' ,
91164 data () {
92165 return {
93- sampleCode: Samples
166+ sampleCode: Samples,
167+ selectedTitle: Samples[' ex1' ].title ,
168+ isModalOpen: false ,
169+ modalClasses: ' show fade in'
94170 };
95171 },
172+ created () {
173+ let routePath = this .$route .path .replace (' /' , ' ' );
174+ routePath = routePath .replace (/ _/ g , ' ' );
175+ routePath = routePath .charAt (0 ).toUpperCase () + routePath .slice (1 );
176+ this .selectedTitle = routePath;
177+ },
96178 methods: {
97179 getClassColumn () {
98- return this .$route .path === ' /column_2d '
180+ return this .$route .path === ' /a_simple_chart '
99181 ? ' nav-item selected'
100182 : ' nav-item' ;
101183 },
102184 getClassPie () {
103- return this .$route .path === ' /3d_pie_chart '
185+ return this .$route .path === ' /a_3d_pie_chart '
104186 ? ' nav-item selected'
105187 : ' nav-item' ;
106188 },
@@ -110,25 +192,45 @@ export default {
110192 : ' nav-item' ;
111193 },
112194 getClassListenEvents () {
113- return this .$route .path === ' /listen_events_chart '
195+ return this .$route .path === ' /listen_to_events_from_chart '
114196 ? ' nav-item selected'
115197 : ' nav-item' ;
116198 },
117199 getClassDrillDown () {
118- return this .$route .path === ' /drill_down '
200+ return this .$route .path === ' /add_drill_down_to_chart '
119201 ? ' nav-item selected'
120202 : ' nav-item' ;
121203 },
122204 getClassGauge () {
123- return this .$route .path === ' /gauge' ? ' nav-item selected' : ' nav-item' ;
205+ return this .$route .path === ' /a_simple_gauge'
206+ ? ' nav-item selected'
207+ : ' nav-item' ;
124208 },
125209 getClassTheme () {
126- return this .$route .path === ' /theme' ? ' nav-item selected' : ' nav-item' ;
210+ return this .$route .path === ' /applying_a_different_theme'
211+ ? ' nav-item selected'
212+ : ' nav-item' ;
127213 },
128214 getClassChangeType () {
129- return this .$route .path === ' /change_type_runtime '
215+ return this .$route .path === ' /change_chart_type_at_runtime '
130216 ? ' nav-item selected'
131217 : ' nav-item' ;
218+ },
219+ getModalClass () {
220+ return this .isModalOpen ? this .modalClasses : ' fade' ;
221+ },
222+ getModalStyle () {
223+ return this .isModalOpen
224+ ? { display: ' block' , ' padding-left' : ' 0px' }
225+ : { display: ' none' };
226+ },
227+ toggleModal (args ) {
228+ this .isModalOpen = args;
229+ },
230+ openPage (page ) {
231+ this .selectedTitle = this .sampleCode [` ex${ page} ` ].title ;
232+ this .$router .push (this .selectedTitle .replace (/ \s + / g , ' _' ).toLowerCase ());
233+ this .isModalOpen = false ;
132234 }
133235 }
134236};
0 commit comments