Skip to content

Commit f763945

Browse files
committed
fix: add horizontalBar type #1
1 parent f6e5494 commit f763945

File tree

4 files changed

+46
-29
lines changed

4 files changed

+46
-29
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@coreui/vue-chartjs",
33
"description": "Vue component wrapper for chart.js",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"license": "MIT",
66
"main": "dist/coreui-vue-chartjs.common.js",
77
"types": "src/index.d.ts",

src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ export declare class CChart extends Vue {
55
labels: [string, Array<string>]
66
options: object
77
plugins: Array<any>
8-
src: string
98
}
109

1110
export declare class CChartBar extends CChart {}
11+
export declare class CChartHorizontalBar extends CChart {}
1212
export declare class CChartLine extends CChart {}
1313
export declare class CChartDoughnut extends CChart {}
1414
export declare class CChartRadar extends CChart {}

src/index.js

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
11
import Chart from './Chart'
22

3-
const CChartBar = Object.assign({}, Chart, { name: 'CChartBar', type: 'bar' })
4-
const CChartLine = Object.assign({}, Chart, { name: 'CChartLine', type: 'line' })
5-
const CChartDoughnut = Object.assign({}, Chart, { name: 'CChartDoughnut', type: 'doughnut' })
6-
const CChartRadar = Object.assign({}, Chart, { name: 'CChartRadar', type: 'radar' })
7-
const CChartPie = Object.assign({}, Chart, { name: 'CChartPie', type: 'pie' })
8-
const CChartPolarArea = Object.assign({}, Chart, { name: 'CChartPolarArea', type: 'polarArea' })
3+
const CChartBar = Object.assign({}, Chart, {
4+
name: 'CChartBar',
5+
type: 'bar'
6+
})
7+
const CChartHorizontalBar = Object.assign({}, Chart, {
8+
name: 'CChartHorizontalBar',
9+
type: 'horizontalBar'
10+
})
11+
const CChartLine = Object.assign({}, Chart, {
12+
name: 'CChartLine',
13+
type: 'line'
14+
})
15+
const CChartDoughnut = Object.assign({}, Chart, {
16+
name: 'CChartDoughnut',
17+
type: 'doughnut'
18+
})
19+
const CChartRadar = Object.assign({}, Chart, {
20+
name: 'CChartRadar',
21+
type: 'radar'
22+
})
23+
const CChartPie = Object.assign({}, Chart, {
24+
name: 'CChartPie',
25+
type: 'pie'
26+
})
27+
const CChartPolarArea = Object.assign({}, Chart, {
28+
name: 'CChartPolarArea',
29+
type: 'polarArea'
30+
})
931

1032
export {
1133
CChartBar,
34+
CChartHorizontalBar,
1235
CChartLine,
1336
CChartDoughnut,
1437
CChartRadar,
@@ -19,6 +42,7 @@ export {
1942
const CoreuiVueCharts = {
2043
install (Vue) {
2144
Vue.component('CChartBar', CChartBar)
45+
Vue.component('CChartHorizontalBar', CChartHorizontalBar)
2246
Vue.component('CChartLine', CChartLine)
2347
Vue.component('CChartDoughnut', CChartDoughnut)
2448
Vue.component('CChartRadar', CChartRadar)

0 commit comments

Comments
 (0)