mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - For Chart
This commit is contained in:
parent
8f2b9e5627
commit
1f215ce431
3 changed files with 56 additions and 27 deletions
48
components/lib/chart/BaseChart.vue
Normal file
48
components/lib/chart/BaseChart.vue
Normal file
|
@ -0,0 +1,48 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
import { useStyle } from 'primevue/usestyle';
|
||||
|
||||
const styles = `
|
||||
.p-chart {
|
||||
position: relative;
|
||||
}
|
||||
`;
|
||||
|
||||
const classes = {
|
||||
root: 'p-chart'
|
||||
};
|
||||
|
||||
const { load: loadStyle } = useStyle(styles, { id: 'primevue_chart_style', manual: true });
|
||||
|
||||
export default {
|
||||
name: 'BaseChart',
|
||||
extends: BaseComponent,
|
||||
props: {
|
||||
type: String,
|
||||
data: null,
|
||||
options: null,
|
||||
plugins: null,
|
||||
width: {
|
||||
type: Number,
|
||||
default: 300
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 150
|
||||
},
|
||||
canvasProps: {
|
||||
type: null,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
css: {
|
||||
classes,
|
||||
loadStyle
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
$parentInstance: this
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue