From 9913f785b3587150e19406fce96c8d6177f10fb4 Mon Sep 17 00:00:00 2001 From: AlexNRCan Date: Fri, 13 Dec 2024 11:12:38 -0500 Subject: [PATCH] Small styling fixes --- src/chart-parsing.ts | 8 ++++---- src/chart-style.ts | 9 +-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/chart-parsing.ts b/src/chart-parsing.ts index 9752b18..5d644d2 100644 --- a/src/chart-parsing.ts +++ b/src/chart-parsing.ts @@ -1,4 +1,4 @@ -import { ChartType, ChartData, ChartDataset, ChartOptions, Tick, PluginChartOptions } from 'chart.js'; +import { Chart as ChartJS, ChartType, ChartData, ChartDataset, ChartOptions, Tick, PluginChartOptions } from 'chart.js'; import { GeoChartConfig, GeoChartXYData, @@ -414,7 +414,7 @@ function createDatasetsLineBar< } else { // 1 feature = 1 dataset // Create dataset - const newDataset = createDataset(chartConfig, undefined, undefined, steps, undefined); + const newDataset = createDataset(chartConfig, ChartJS.defaults.color as string, undefined, steps, undefined); returnedChartData.datasets.push(newDataset); // For each record @@ -482,7 +482,7 @@ function createDatasetsPieDoughnut< // If new category if (!Object.keys(categoriesRead).includes(catName)) { // Create dataset - const newDataset = createDataset(chartConfig, paletteBackgroundAll, undefined, undefined, catName); + const newDataset = createDataset(chartConfig, paletteBackgroundAll, ChartJS.defaults.color as string, undefined, catName); categoriesRead[catName] = { index: idx++, data: newDataset.data }; returnedChartData.datasets.push(newDataset); } @@ -502,7 +502,7 @@ function createDatasetsPieDoughnut< } else { // 1 feature = 1 dataset // Create dataset - const newDataset = createDataset(chartConfig, undefined, undefined, undefined, undefined); + const newDataset = createDataset(chartConfig, ChartJS.defaults.color as string, undefined, undefined, undefined); returnedChartData.datasets.push(newDataset); // Compress the data for the ChartDataset diff --git a/src/chart-style.ts b/src/chart-style.ts index 49321f8..5d98d18 100644 --- a/src/chart-style.ts +++ b/src/chart-style.ts @@ -46,13 +46,7 @@ export const getSxClasses = (theme: Theme) => { marginLeft: 'auto', '& button': { height: '40px', - textTransform: 'capitalize', - backgroundColor: theme.palette.geoViewColor?.bgColor.dark[100], - color: theme.palette.geoViewColor?.textColor.main, - '&:hover': { - backgroundColor: theme.palette.geoViewColor?.bgColor.dark[50], - color: theme.palette.geoViewColor?.textColor.main, - }, + textTransform: 'capitalize' }, }, dataset: { @@ -118,7 +112,6 @@ export const getSxClasses = (theme: Theme) => { ySliderWrapper: { height: '70%', textAlign: 'center', - marginTop: '-20px', marginLeft: '20px', '& .MuiSlider-root': { color: theme.palette.geoViewColor?.primary.main,