-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathHorizontalBarChartWithAxis.AxisTooltip.Example.tsx
66 lines (62 loc) · 1.61 KB
/
HorizontalBarChartWithAxis.AxisTooltip.Example.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import * as React from 'react';
import {
HorizontalBarChartWithAxis,
IHorizontalBarChartWithAxisProps,
IHorizontalBarChartWithAxisDataPoint,
DataVizPalette,
getColorFromToken,
} from '@fluentui/react-charting';
interface IHorizontalBarChartWithAxisState {
selectedOption: string;
}
export class HorizontalBarChartWithAxisTooltipExample extends React.Component<{}, IHorizontalBarChartWithAxisState> {
constructor(props: IHorizontalBarChartWithAxisProps) {
super(props);
this.state = {
selectedOption: 'showTooltip',
};
}
public render(): JSX.Element {
return <div>{this._basicExample()}</div>;
}
private _basicExample(): JSX.Element {
const points: IHorizontalBarChartWithAxisDataPoint[] = [
{
x: 1000,
y: 1000,
color: getColorFromToken(DataVizPalette.color5),
},
{
x: 2000,
y: 5000,
color: getColorFromToken(DataVizPalette.color6),
},
{
x: 3000,
y: 3000,
color: getColorFromToken(DataVizPalette.color7),
},
{
x: 4000,
y: 2000,
color: getColorFromToken(DataVizPalette.color8),
},
];
const rootStyle = { width: '650px', height: '350px' };
return (
<div className="containerDiv">
<div style={rootStyle}>
<HorizontalBarChartWithAxis
chartTitle="Horizontal bar chart axis tooltip example "
data={points}
height={350}
width={650}
hideLegend={true}
hideTooltip={false}
enableReflow={true}
/>
</div>
</div>
);
}
}