Merge pull request #76 from appwrite/fix-charts-colors

fix: proper colors for usage charts
This commit is contained in:
Torsten Dittmann authored and GitHub committed 2022-10-13 15:32:24 +02:00
commit 989ba36bf8
5 files changed
+17 -7

No files matched your search

-1
View File
@@ -1,5 +1,4 @@
{
"color": ["#ff80b7", "#a1c4ff", "#cbb1fc", "#94dbd1", "#fdc584", "#f02e65", "#ffa1a1"],
"backgroundColor": "rgba(255,255,255,0)",
"textStyle": {},
"line": {
+8
View File
@@ -1,6 +1,14 @@
import type { EChartsOption } from 'echarts';
export enum Colors {
Primary = '#F02E65',
Secondary = '#94DBD1',
Tertiary = '#A1C4FF',
Quaternary = '#CBB1FC',
Quinary = '#FDC584'
}
export const defaultConfig: EChartsOption = {
color: Object.values(Colors),
animation: false,
tooltip: {
trigger: 'axis'
-1
View File
@@ -1,5 +1,4 @@
{
"color": ["#f02e65", "#a1c4ff", "#cbb1fc", "#94dbd1", "#fdc584", "#f02e65", "#ffa1a1"],
"backgroundColor": "rgba(0,0,0,0)",
"title": {
"textStyle": {
-1
View File
@@ -1,5 +1,4 @@
{
"color": ["#ff80b7", "#a1c4ff", "#cbb1fc", "#94dbd1", "#fdc584", "#f02e65", "#ffa1a1"],
"backgroundColor": "rgba(255,255,255,0)",
"title": {
"textStyle": {
+9 -4
View File
@@ -6,6 +6,7 @@
import { Container } from '$lib/layout';
import { BarChart, LineChart } from '$lib/charts';
import { Card, DropTabs, DropTabsItem, Tiles } from '$lib/components';
import { Colors } from '$lib/charts/config';
import type { Models } from '@aw-labs/appwrite-console';
type MetricMetadata = {
@@ -75,7 +76,8 @@
series={[
{
name: createdMetadata.legend,
data: [...created.map((e) => [e.date, e.value])]
data: [...created.map((e) => [e.date, e.value])],
color: Colors.Secondary
}
]} />
{/if}
@@ -89,7 +91,8 @@
series={[
{
name: readMetadata.legend,
data: [...read.map((e) => [e.date, e.value])]
data: [...read.map((e) => [e.date, e.value])],
color: Colors.Tertiary
}
]} />
{/if}
@@ -103,7 +106,8 @@
series={[
{
name: updatedMetadata.legend,
data: [...updated.map((e) => [e.date, e.value])]
data: [...updated.map((e) => [e.date, e.value])],
color: Colors.Quaternary
}
]} />
{/if}
@@ -117,7 +121,8 @@
series={[
{
name: deletedMetadata.legend,
data: [...deleted.map((e) => [e.date, e.value])]
data: [...deleted.map((e) => [e.date, e.value])],
color: Colors.Quinary
}
]} />
{/if}