/
index.tsx
48 lines (46 loc) · 2.09 KB
/
index.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
import * as React from "react";
import { appTheme } from "../../../theme";
import { SciChartGroup, SciChartReact } from "scichart-react";
import classes from "../../../styles/Examples.module.scss";
import { getChartsInitializationAPI } from "./drawExample";
// React component needed as our examples app is react.
// SciChart can be used in Angular, Vue, Blazor and vanilla JS! See our Github repo for more info
export default function InteractiveWaterfallChart() {
const [chartsInitializationAPI] = React.useState(getChartsInitializationAPI);
return (
<React.Fragment>
<div style={{ background: appTheme.Background }} className={classes.ChartWrapper}>
<div
style={{
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
background: appTheme.DarkIndigo,
}}
>
<SciChartGroup
onInit={() => {
chartsInitializationAPI.configureAfterInit();
}} // callback executed when all charts within the group are initialized
>
<SciChartReact
style={{ flex: 1, flexBasis: "50%" }}
initChart={chartsInitializationAPI.initMainChart}
/>
<div style={{ display: "flex", flex: 1, flexBasis: "50%" }}>
<SciChartReact
style={{ flex: 1 }}
initChart={chartsInitializationAPI.initCrossSectionLeft}
/>
<SciChartReact
style={{ flex: 1 }}
initChart={chartsInitializationAPI.initCrossSectionRight}
/>
</div>
</SciChartGroup>
</div>
</div>
</React.Fragment>
);
}