Skip to content

Commit

Permalink
fix: 条形图
Browse files Browse the repository at this point in the history
  • Loading branch information
tiger5wang committed Nov 27, 2024
1 parent 1bf7470 commit 738f7b3
Showing 1 changed file with 40 additions and 42 deletions.
82 changes: 40 additions & 42 deletions src/Bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,48 +240,46 @@ const Bar: FC<BarConfig> = ({

return (
<div className={`${prefixCls} ${className}`} style={style}>
<div className={`${prefixCls}-main`}>
<Composite
title={title}
legend={legend}
seriesField={seriesField}
colorMap={colorMap}
timeRange={timeRange}
>
{
empty ? (
<div className={`${prefixCls}-empty`}>
{typeof empty === 'boolean' ? '暂无内容' : empty}
</div>
) : (
<div style={{ display: 'flex', height }}>
<BaseBar {...newConfig} className={`${prefixCls}-main`} />
{showLabelValue.includes(type) && (
<div
className={`${prefixCls}-label-value ${
type === 'alone' ? `${prefixCls}-label-value-alone` : ''
}`}
>
{labelData.map((item) => (
<div
key={item.label}
className={`${prefixCls}-label-value-item`}
>
{item.value}
</div>
))}
</div>
)}
</div>
)
// ['basic', 'alone'].includes(type) ? (
// <CustomBar type={type as 'basic' | 'alone'} data={originalData} />
// ) : (
// <BaseBar {...newConfig} style={{flex: 1}} />
// )
}
</Composite>
</div>
<Composite
title={title}
legend={legend}
seriesField={seriesField}
colorMap={colorMap}
timeRange={timeRange}
>
{
empty ? (
<div className={`${prefixCls}-empty`}>
{typeof empty === 'boolean' ? '暂无内容' : empty}
</div>
) : (
<div style={{ display: 'flex', height }}>
<BaseBar {...newConfig} className={`${prefixCls}-main`} />
{showLabelValue.includes(type) && (
<div
className={`${prefixCls}-label-value ${
type === 'alone' ? `${prefixCls}-label-value-alone` : ''
}`}
>
{labelData.map((item) => (
<div
key={item.label}
className={`${prefixCls}-label-value-item`}
>
{item.value}
</div>
))}
</div>
)}
</div>
)
// ['basic', 'alone'].includes(type) ? (
// <CustomBar type={type as 'basic' | 'alone'} data={originalData} />
// ) : (
// <BaseBar {...newConfig} style={{flex: 1}} />
// )
}
</Composite>
</div>
);
};
Expand Down

0 comments on commit 738f7b3

Please sign in to comment.