Skip to content

Commit

Permalink
fix(HotMap): 更新HotMap字体颜色 (#381)
Browse files Browse the repository at this point in the history
Co-authored-by: Zhang Rui <[email protected]>
  • Loading branch information
Quesle and Zhang Rui authored Apr 11, 2024
1 parent 4c56f5d commit a95bd82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/hot-map/demos/HotMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const BaseHotMapArgs = {
offsetY: 62,
fixedOffsetY: 100,
},
className: 'custom-tooltip-class',
render(options) {
const { data, onClick } = options;
const sourceData = data?.[0]?.data;
Expand Down
4 changes: 2 additions & 2 deletions src/hot-map/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export class HotMap extends BaseChart {
style: {
fill: '#fff',
fontSize: 14,
shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0, .45)',
// shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0)',
},
content: (val) => {
return `${formatPercent(val?.[zField] || 0)}`;
Expand Down
6 changes: 4 additions & 2 deletions src/info-card/InfoCardBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState, useMemo } from 'react';
import { ChartConfig, ChartOptions, Legends, Legend, ChartType } from '../interfaces';
import { getInfoCardStyles, getLegendStyles } from '../utils/styles';
import InfoCard from './InfoCard';
import { debounce, first, last, set } from 'lodash';
import { debounce, first, get, last, set } from 'lodash';

import './styles/infocard.less';
import { LooseObject } from '@antv/g-base';
Expand Down Expand Up @@ -52,6 +52,8 @@ const InfoCardBox = (props: InfoCardProps) => {
const [title, setTitle] = useState('');
const setHoverItemD = useMemo(() => debounce(setItems, 20), [setItems]);

const tipClassName = get(config, 'tooltip.className');

const [, update] = useState(0);

const triggerInfo = getTrigger?.();
Expand Down Expand Up @@ -123,7 +125,7 @@ const InfoCardBox = (props: InfoCardProps) => {
// That is expected to update items, it seams it's better to direct use without useEffect.
return (
<div
className={`gio-d-charts-infocard `}
className={`gio-d-charts-infocard ${tipClassName}`}
data-testid="infoCardBox"
onMouseLeave={onMouseLeave}
style={{ maxHeight: (height - 60) * 0.75 }}
Expand Down

0 comments on commit a95bd82

Please sign in to comment.