Skip to content

Commit 77d8096

Browse files
committed
Config - Fix config mistakes
1 parent 8045bf3 commit 77d8096

File tree

1 file changed

+62
-12
lines changed

1 file changed

+62
-12
lines changed

src/useConfig.js

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ export function useConfig() {
2424
_48: 48
2525
}
2626

27+
// -------------------------
28+
// COMBOS TO APPLY
29+
30+
/**
31+
* Sets background and text color.
32+
*
33+
* @param {string} [backgroundColor] - Background color (default is #FFFFFF).
34+
* @param {string} [color] - Text color (default is #2D353C).
35+
* @returns {{backgroundColor: string, color: string}} An object with the background color and text color.
36+
*/
37+
const BG_AND_COLOR = (backgroundColor = COLOR_WHITE, color = COLOR_BLACK) => {
38+
return { backgroundColor, color }
39+
}
40+
41+
const PREFIX_SUFFIX = {
42+
prefix: '',
43+
suffix: ''
44+
}
45+
46+
// --------------------------
47+
2748
const SHAPE = {
2849
LINE: 'line',
2950
SQUARE: 'square',
@@ -426,7 +447,7 @@ export function useConfig() {
426447
...TOOLTIP,
427448
showValue: true,
428449
showPercentage: true,
429-
rondingValue: 0,
450+
roundingValue: 0,
430451
roundingPercentage: 0
431452
},
432453
userOptions: USER_OPTIONS({
@@ -535,7 +556,7 @@ export function useConfig() {
535556
roundingPercentage: 0,
536557
},
537558
columnNames: {
538-
serie: 'Series',
559+
series: 'Series',
539560
value: 'Value',
540561
percentage: 'Percentage'
541562
}
@@ -760,7 +781,7 @@ export function useConfig() {
760781
},
761782
rect: {
762783
rounded: true,
763-
ronding: 2,
784+
rounding: 2,
764785
stroke: COLOR_BLACK,
765786
strokeWidth: 1,
766787
useGradient: true,
@@ -2004,9 +2025,18 @@ export function useConfig() {
20042025
}
20052026
},
20062027
title: {
2007-
...TITLE,
2028+
text: '',
2029+
color: COLOR_BLACK,
2030+
fontSize: FONT._16,
2031+
bold: true,
20082032
textAlign: POSITION.LEFT,
2009-
margin: '0 auto'
2033+
margin: '0 0 6px 0',
2034+
subtitle: {
2035+
color: COLOR_GREY,
2036+
text: '',
2037+
fontSize: FONT._12,
2038+
bold: false
2039+
},
20102040
},
20112041
gap: 4
20122042
}
@@ -2119,9 +2149,18 @@ export function useConfig() {
21192149
borderRadius: 2
21202150
},
21212151
title: {
2122-
...TITLE,
2152+
text: '',
2153+
color: COLOR_BLACK,
2154+
fontSize: FONT._16,
2155+
bold: true,
21232156
textAlign: POSITION.LEFT,
2124-
margin: '0 0 6px 0'
2157+
subtitle: {
2158+
color: COLOR_GREY,
2159+
text: '',
2160+
fontSize: FONT._12,
2161+
bold: false
2162+
},
2163+
margin: '0 0 6px 0',
21252164
}
21262165
}
21272166
}
@@ -3285,9 +3324,18 @@ export function useConfig() {
32853324
chart: 'Evolution'
32863325
},
32873326
title: {
3288-
...TITLE,
3289-
textAlign: POSITION.CENTER,
3290-
backgroundColor: COLOR_WHITE
3327+
text: '',
3328+
color: COLOR_BLACK,
3329+
fontSize: FONT._20,
3330+
bold: true,
3331+
textAlign: 'center',
3332+
backgroundColor: COLOR_WHITE,
3333+
subtitle: {
3334+
color: COLOR_GREY,
3335+
text: '',
3336+
fontSize: FONT._16,
3337+
bold: false
3338+
},
32913339
},
32923340
thead: {
32933341
backgroundColor: COLOR_WHITE,
@@ -3367,8 +3415,10 @@ export function useConfig() {
33673415
height: 300,
33683416
width: 512,
33693417
zoom: {
3370-
...ZOOM,
3371-
show: false
3418+
show: false,
3419+
color: COLOR_GREY_MID,
3420+
highlightColor: COLOR_GREY_DARK,
3421+
useResetSlot: false
33723422
},
33733423
words: {
33743424
maxFontSize: 100,

0 commit comments

Comments
 (0)