-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Histogram): provided testing interface
- Loading branch information
1 parent
6002c58
commit 3805aa5
Showing
2 changed files
with
61 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import { Space } from 'antd'; | ||
import { Histogram } from '../../src/index'; | ||
import ResizableCard from './Util/ResizableCard'; | ||
|
||
const TestBarChart: React.FC = () => { | ||
const [sizeStateResponsive, setSizeStateResponsive] = React.useState({ width: 500, height: 500 }); | ||
const [sizeStateFixed, setSizeStateFixed] = React.useState({ width: 960, height: 600 }); | ||
return ( | ||
<Space direction="vertical" size={150}> | ||
<ResizableCard title="Fixed Histogram" sizeState={sizeStateFixed} onSizeChange={setSizeStateFixed}> | ||
<Histogram | ||
data={[ | ||
{ x: 'AB', y: 50 }, | ||
{ x: 'NB', y: 75 }, | ||
{ x: 'SB', y: 60 }, | ||
{ x: 'AU', y: 30 }, | ||
{ x: 'XA', y: 80 }, | ||
{ x: 'BB', y: 50 }, | ||
{ x: 'BC', y: 75 }, | ||
{ x: 'BD', y: 60 }, | ||
{ x: 'BE', y: 30 }, | ||
{ x: 'BF', y: 80 }, | ||
]} | ||
units="management units" | ||
height={sizeStateFixed.height} | ||
width={sizeStateFixed.width} | ||
/> | ||
</ResizableCard> | ||
<ResizableCard title="Responsive Histogram" sizeState={sizeStateResponsive} onSizeChange={setSizeStateResponsive}> | ||
<Histogram | ||
data={[ | ||
{ x: 'AB', y: 50 }, | ||
{ x: 'NB', y: 75 }, | ||
{ x: 'SB', y: 60 }, | ||
{ x: 'AU', y: 30 }, | ||
{ x: 'XA', y: 80 }, | ||
]} | ||
units="management units" | ||
height={sizeStateResponsive.height} | ||
/> | ||
</ResizableCard> | ||
</Space> | ||
); | ||
}; | ||
|
||
export default TestBarChart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters