eztech-core-components 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/charts/LineChart.vue +12 -39
- package/package.json +4 -1
- package/plugins/chart.js +3 -3
- package/utils/default-nuxt-config.js +1 -1
package/charts/LineChart.vue
CHANGED
|
@@ -1,55 +1,28 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { Line } from 'vue-chartjs'
|
|
3
|
+
import ChartDataLabels from 'chartjs-plugin-datalabels'
|
|
3
4
|
export default {
|
|
4
5
|
name: 'LineChart',
|
|
5
6
|
extends: Line,
|
|
6
7
|
props: {
|
|
7
|
-
|
|
8
|
+
chartData: { type: Object, required: true },
|
|
9
|
+
chartOptions: {
|
|
8
10
|
type: Object,
|
|
9
|
-
required: false,
|
|
10
|
-
default: () => { return null }
|
|
11
|
-
},
|
|
12
|
-
options: {
|
|
13
|
-
type: Object,
|
|
14
|
-
required: false,
|
|
15
11
|
default: () => ({
|
|
16
12
|
responsive: true,
|
|
17
|
-
maintainAspectRatio: false
|
|
18
|
-
legend: {
|
|
19
|
-
display: true
|
|
20
|
-
},
|
|
21
|
-
interaction: {
|
|
22
|
-
mode: 'index',
|
|
23
|
-
intersect: false
|
|
24
|
-
},
|
|
25
|
-
scales: {
|
|
26
|
-
yAxes: [{
|
|
27
|
-
ticks: {
|
|
28
|
-
fontColor: 'rgb(75, 85, 99)',
|
|
29
|
-
suggestedMin: 30,
|
|
30
|
-
suggestedMax: 50
|
|
31
|
-
}
|
|
32
|
-
}],
|
|
33
|
-
xAxes: [{
|
|
34
|
-
ticks: {
|
|
35
|
-
fontColor: 'rgb(75, 85, 99)'
|
|
36
|
-
}
|
|
37
|
-
}]
|
|
38
|
-
},
|
|
39
|
-
title: {
|
|
40
|
-
display: false,
|
|
41
|
-
text: ''
|
|
42
|
-
}
|
|
13
|
+
maintainAspectRatio: false
|
|
43
14
|
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.renderChart(this.data, this.options)
|
|
15
|
+
},
|
|
16
|
+
showLabels: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true
|
|
49
19
|
}
|
|
50
20
|
},
|
|
51
21
|
mounted () {
|
|
52
|
-
|
|
22
|
+
if (this.showLabels) {
|
|
23
|
+
this.addPlugin(ChartDataLabels)
|
|
24
|
+
}
|
|
25
|
+
this.renderChart(this.chartData, this.chartOptions)
|
|
53
26
|
}
|
|
54
27
|
}
|
|
55
28
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eztech-core-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,12 +35,15 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"axios": "^0.30.0",
|
|
37
37
|
"chart.js": "^2.9.4",
|
|
38
|
+
"chartjs-plugin-datalabels": "^0.7.0",
|
|
38
39
|
"vue": "^2.7.10",
|
|
39
40
|
"vue-chartjs": "^3.5.1",
|
|
40
41
|
"vue-cropperjs": "^4.2.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@babel/eslint-parser": "^7.19.1",
|
|
45
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
46
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
44
47
|
"@nuxtjs/eslint-config": "^11.0.0",
|
|
45
48
|
"@nuxtjs/eslint-module": "^3.1.0",
|
|
46
49
|
"@nuxtjs/moment": "^1.6.1",
|
package/plugins/chart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import Chart from 'chart.js'
|
|
3
|
-
import ChartDataLabels from 'chartjs-plugin-datalabels'
|
|
4
|
-
Chart.plugins.register(ChartDataLabels)
|
|
2
|
+
// import Chart from 'chart.js'
|
|
3
|
+
// import ChartDataLabels from 'chartjs-plugin-datalabels'
|
|
4
|
+
// Chart.plugins.register(ChartDataLabels)
|
|
5
5
|
/* eslint-enable */
|
|
@@ -103,7 +103,7 @@ export const getDefaultConfig = (options) => {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
if (!options?.ignoreElementUi) {
|
|
106
|
-
build.transpile = [/^element-ui/, 'eztech-core-components'
|
|
106
|
+
build.transpile = [/^element-ui/, 'eztech-core-components']
|
|
107
107
|
}
|
|
108
108
|
// ,
|
|
109
109
|
// vue: {
|