Commit 1d237d3d authored by Mele's avatar Mele
Browse files

Remove .env.docker from Git and add to .gitignore

parent ac23dc7f
<template>
<div class="chart-card">
<h3>{{ title }}</h3>
<Line :data="chartData" :options="chartOptions" />
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import type { PropType } from 'vue';
import {
Chart as ChartJS,
Title,
Tooltip,
Legend,
LineElement,
PointElement,
CategoryScale,
LinearScale
} from 'chart.js';
import { Line } from 'vue-chartjs';
import type { ChartData, ChartOptions } from 'chart.js';
// ⛳️ WICHTIG: Registrierung außerhalb von defineComponent
ChartJS.register(
Title,
Tooltip,
Legend,
LineElement,
PointElement,
CategoryScale,
LinearScale
);
export default defineComponent({
name: 'ChartCard',
components: {
Line
},
props: {
title: {
type: String,
required: true
},
labels: {
type: Array as PropType<string[]>,
required: true
},
data: {
type: Array as PropType<number[]>,
required: true
},
borderColor: {
type: String,
required: true
}
},
computed: {
chartData(): ChartData<'line'> {
return {
labels: this.labels,
datasets: [
{
label: this.title,
data: this.data,
fill: false,
borderColor: this.borderColor,
tension: 0.3
}
]
};
},
chartOptions(): ChartOptions<'line'> {
return {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true
}
}
};
}
}
});
</script>
<style scoped>
.chart-card {
width: 300px;
height: 250px;
background: white;
padding: 1rem;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.chart-card h3 {
text-align: center;
margin-bottom: 0.5rem;
font-size: 1rem;
}
</style>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment