diff --git a/doc/chart/BasicDoc.vue b/doc/chart/BasicDoc.vue
index 74802a4e0..36f3b7a1e 100644
--- a/doc/chart/BasicDoc.vue
+++ b/doc/chart/BasicDoc.vue
@@ -15,25 +15,8 @@
export default {
data() {
return {
- chartData: {
- labels: ['Q1', 'Q2', 'Q3', 'Q4'],
- datasets: [
- {
- label: 'Sales',
- data: [540, 325, 702, 620],
- backgroundColor: ['rgba(255, 159, 64, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(153, 102, 255, 0.2)'],
- borderColor: ['rgb(255, 159, 64)', 'rgb(75, 192, 192)', 'rgb(54, 162, 235)', 'rgb(153, 102, 255)'],
- borderWidth: 1
- }
- ]
- },
- chartOptions: {
- scales: {
- y: {
- beginAtZero: true
- }
- }
- },
+ chartData: null,
+ chartOptions: null,
code: {
basic: `
`,
@@ -48,7 +31,17 @@ export default {
export default {
data() {
return {
- chartData: {
+ chartData: null,
+ chartOptions: null
+ };
+ },
+ mounted() {
+ this.chartData = this.setChartData();
+ this.chartOptions = this.setChartOptions();
+ },
+ methods: {
+ setChartData() {
+ return {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [
{
@@ -59,15 +52,43 @@ export default {
borderWidth: 1
}
]
- },
- chartOptions: {
+ };
+ },
+ setChartOptions() {
+ const documentStyle = getComputedStyle(document.documentElement);
+ const textColor = documentStyle.getPropertyValue('--text-color');
+ const textColorSecondary = documentStyle.getPropertyValue('--text-color-secondary');
+ const surfaceBorder = documentStyle.getPropertyValue('--surface-border');
+
+ return {
+ plugins: {
+ legend: {
+ labels: {
+ color: textColor
+ }
+ }
+ },
scales: {
+ x: {
+ ticks: {
+ color: textColorSecondary
+ },
+ grid: {
+ color: surfaceBorder
+ }
+ },
y: {
- beginAtZero: true
+ beginAtZero: true,
+ ticks: {
+ color: textColorSecondary
+ },
+ grid: {
+ color: surfaceBorder
+ }
}
}
- }
- };
+ };
+ }
}
};
<\/script>`,
@@ -79,30 +100,123 @@ export default {