-
-
Notifications
You must be signed in to change notification settings - Fork 2
Standard Graphs
David Jablonski edited this page Mar 15, 2025
·
6 revisions
- All charts are located in
src/lib/components/charts/. - Each standalone chart has its own folder,
src/lib/components/charts/custom/ChartXY- Country-specific charts are loaded via the environment variable from
index.svelte.
- Country-specific charts are loaded via the environment variable from
Standard charts are:
chartBar.sveltechartDots.sveltechartLine.svelte
datasort = ''source = ''label = ''lines = []-
visualisation = 'standard'(default:'standard','stacked','grouped') xAxixInterval = 1unit = ''show0ValuesInLegend = falsefreezeYAxis = false
dataradius = 5colors = ['#313695', '#a50026']unit = ''yLabel = ''
datakeys = []labels = []-
visualisation(default: not stacked,'stacked') colorsshowLegend = trueunit = ''showAreas = falseshowDots = falseshowTotal = truelineWidth = 3circleRadius = 5marginLeft = 20xTicksInterval = 10minValue = 0
<script>
import LineChart from '../chartLine.svelte';
const keys = ['energy', 'industry', 'agriculture'];
const labels = ['Energie', 'Industrie', 'Landwirtschaft'];
const colors = ['#BD3737', '#373949', '#65987D'];
$: dataset = rawData?.map((entry, i) => {
return {
x: i,
label: entry.year,
energy: 25,
industry: 70,
agriculture: 5,
};
});
</script>
{#if dataset.length > 0}
<LineChart
showAreas={true}
data={dataset}
{keys}
{labels}
{colors}
lineWidth="2"
xTicksInterval={chartWidth > 600 ? 10 : 50}
visualisation="stacked"
unit=" Mio t CO2eq"
/>
{/if}