Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel2
Web
Commits
1d237d3d
Commit
1d237d3d
authored
Jun 04, 2025
by
Mele
Browse files
Remove .env.docker from Git and add to .gitignore
parent
ac23dc7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/ChartCard.vue
0 → 100644
View file @
1d237d3d
<
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment