Add pie color legend to Top-Tables

This commit is contained in:
Christoph Kluge
2023-08-11 09:41:39 +02:00
parent e91cdf6b79
commit 32420fb531
3 changed files with 42 additions and 27 deletions

View File

@@ -1,5 +1,22 @@
<script context="module">
// http://tsitsul.in/blog/coloropt/ : 12 colors normal
export const colors = [
'rgb(235,172,35)',
'rgb(184,0,88)',
'rgb(0,140,249)',
'rgb(0,110,0)',
'rgb(0,187,173)',
'rgb(209,99,230)',
'rgb(178,69,2)',
'rgb(255,146,135)',
'rgb(89,84,214)',
'rgb(0,198,248)',
'rgb(135,133,0)',
'rgb(0,167,108)',
'rgb(189,189,189)'
]
</script>
<script>
// import { getContext } from 'svelte'
import { Pie } from 'svelte-chartjs';
import {
Chart as ChartJS,
@@ -24,23 +41,6 @@
export let entities
export let displayLegend = false
// http://tsitsul.in/blog/coloropt/ : 12 colors normal
const colors = [
'rgb(235,172,35)',
'rgb(184,0,88)',
'rgb(0,140,249)',
'rgb(0,110,0)',
'rgb(0,187,173)',
'rgb(209,99,230)',
'rgb(178,69,2)',
'rgb(255,146,135)',
'rgb(89,84,214)',
'rgb(0,198,248)',
'rgb(135,133,0)',
'rgb(0,167,108)',
'rgb(189,189,189)'
]
const data = {
labels: entities,
datasets: [