From cb718f16942e2db002ff2071d2c1f525a6acd264 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Tue, 1 Jan 2019 22:36:31 +0300 Subject: [PATCH] Implemented Chart Component --- src/AppMenu.vue | 5 + src/router.js | 25 ++++ src/views/chart/BarChartDemo.vue | 160 +++++++++++++++++++++++++ src/views/chart/ComboChartDemo.vue | 6 +- src/views/chart/DoughnutChartDemo.vue | 41 +++++++ src/views/chart/LineChartDemo.vue | 113 +++++++++++++++++ src/views/chart/PieChartDemo.vue | 6 +- src/views/chart/PolarAreaChartDemo.vue | 49 ++++++++ src/views/chart/RadarChartDemo.vue | 48 ++++++++ 9 files changed, 447 insertions(+), 6 deletions(-) create mode 100644 src/views/chart/BarChartDemo.vue create mode 100644 src/views/chart/DoughnutChartDemo.vue create mode 100644 src/views/chart/LineChartDemo.vue create mode 100644 src/views/chart/PolarAreaChartDemo.vue create mode 100644 src/views/chart/RadarChartDemo.vue diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 41f8dcb91..5a18aaecc 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -109,6 +109,11 @@
● ChartModel ● Pie + ● Doughnut + ● Bar + ● Line + ● PolarArea + ● Radar ● Combo
diff --git a/src/router.js b/src/router.js index 0542cee88..c0176fbca 100644 --- a/src/router.js +++ b/src/router.js @@ -31,16 +31,41 @@ export default new Router({ name: 'chart', component: () => import('./views/chart/ChartDemo.vue') }, + { + path: '/chart/bar', + name: 'barchart', + component: () => import('./views/chart/BarChartDemo.vue') + }, { path: '/chart/combo', name: 'combochart', component: () => import('./views/chart/ComboChartDemo.vue') }, + { + path: '/chart/doughnut', + name: 'doughnutchart', + component: () => import('./views/chart/DoughnutChartDemo.vue') + }, + { + path: '/chart/line', + name: 'linechart', + component: () => import('./views/chart/LineChartDemo.vue') + }, { path: '/chart/pie', name: 'piechart', component: () => import('./views/chart/PieChartDemo.vue') }, + { + path: '/chart/polararea', + name: 'polarareachart', + component: () => import('./views/chart/PolarAreaChartDemo.vue') + }, + { + path: '/chart/radar', + name: 'radarchart', + component: () => import('./views/chart/RadarChartDemo.vue') + }, { path: '/checkbox', name: 'checkbox', diff --git a/src/views/chart/BarChartDemo.vue b/src/views/chart/BarChartDemo.vue new file mode 100644 index 000000000..73484f85e --- /dev/null +++ b/src/views/chart/BarChartDemo.vue @@ -0,0 +1,160 @@ + + + diff --git a/src/views/chart/ComboChartDemo.vue b/src/views/chart/ComboChartDemo.vue index 17e86ec3c..092b4abee 100644 --- a/src/views/chart/ComboChartDemo.vue +++ b/src/views/chart/ComboChartDemo.vue @@ -2,13 +2,13 @@
-

ComboChart

+

Combo Chart

Different chart types can be combined in the same graph.

- +
@@ -17,7 +17,7 @@ export default { data() { return { - chartModel: { + chartData: { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [{ type: 'line', diff --git a/src/views/chart/DoughnutChartDemo.vue b/src/views/chart/DoughnutChartDemo.vue new file mode 100644 index 000000000..f5173dbe0 --- /dev/null +++ b/src/views/chart/DoughnutChartDemo.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/views/chart/LineChartDemo.vue b/src/views/chart/LineChartDemo.vue new file mode 100644 index 000000000..83bc293b6 --- /dev/null +++ b/src/views/chart/LineChartDemo.vue @@ -0,0 +1,113 @@ + + + diff --git a/src/views/chart/PieChartDemo.vue b/src/views/chart/PieChartDemo.vue index b144938ab..d53778063 100644 --- a/src/views/chart/PieChartDemo.vue +++ b/src/views/chart/PieChartDemo.vue @@ -2,13 +2,13 @@
-

PieChart

+

Pie Chart

A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion.

- +
@@ -17,7 +17,7 @@ export default { data() { return { - chartModel: { + chartData: { labels: ['A','B','C'], datasets: [ { diff --git a/src/views/chart/PolarAreaChartDemo.vue b/src/views/chart/PolarAreaChartDemo.vue new file mode 100644 index 000000000..d04cc1810 --- /dev/null +++ b/src/views/chart/PolarAreaChartDemo.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/views/chart/RadarChartDemo.vue b/src/views/chart/RadarChartDemo.vue new file mode 100644 index 000000000..9fcfd4d90 --- /dev/null +++ b/src/views/chart/RadarChartDemo.vue @@ -0,0 +1,48 @@ + + +