|
|
@@ -55,7 +55,14 @@ class Bar extends Component {
|
|
|
};
|
|
|
|
|
|
render() {
|
|
|
- const { height, title, forceFit = true, data, color = 'rgba(24, 144, 255, 0.85)', padding } = this.props;
|
|
|
+ const {
|
|
|
+ height,
|
|
|
+ title,
|
|
|
+ forceFit = true,
|
|
|
+ data,
|
|
|
+ color = 'rgba(24, 144, 255, 0.85)',
|
|
|
+ padding,
|
|
|
+ } = this.props;
|
|
|
|
|
|
const { autoHideXLabels } = this.state;
|
|
|
|
|
|
@@ -79,16 +86,21 @@ class Bar extends Component {
|
|
|
return (
|
|
|
<div className={styles.chart} style={{ height }} ref={this.handleRoot}>
|
|
|
<div ref={this.handleRef}>
|
|
|
- {title && <h4>{title}</h4>}
|
|
|
+ {title && <h4 style={{ marginBottom: 20 }}>{title}</h4>}
|
|
|
<Chart
|
|
|
scale={scale}
|
|
|
- height={height}
|
|
|
+ height={title ? height - 41 : height}
|
|
|
forceFit={forceFit}
|
|
|
data={data}
|
|
|
padding={padding || 'auto'}
|
|
|
>
|
|
|
- <Axis name="x" title={false} label={!autoHideXLabels} tickLine={!autoHideXLabels} />
|
|
|
- <Axis name="y" title={false} line={false} tickLine={false} min={0} />
|
|
|
+ <Axis
|
|
|
+ name="x"
|
|
|
+ title={false}
|
|
|
+ label={autoHideXLabels ? false : {}}
|
|
|
+ tickLine={autoHideXLabels ? false : {}}
|
|
|
+ />
|
|
|
+ <Axis name="y" min={0} />
|
|
|
<Tooltip showTitle={false} crosshairs={false} />
|
|
|
<Geom type="interval" position="x*y" color={color} tooltip={tooltip} />
|
|
|
</Chart>
|