2023-05-31 06:44:48 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const styles = `
|
2023-09-26 09:14:27 +00:00
|
|
|
@layer primevue {
|
2023-09-25 19:11:55 +00:00
|
|
|
.p-chart {
|
|
|
|
position: relative;
|
|
|
|
}
|
2023-05-31 06:44:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: 'p-chart'
|
|
|
|
};
|
|
|
|
|
2023-07-03 22:20:35 +00:00
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'chart', manual: true });
|
2023-05-31 06:44:48 +00:00
|
|
|
|
|
|
|
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>
|