Open wozhendeai opened 10 months ago
Yes. You can start with "legend" or "moving everage" examples on the demo page
Oh I should update the examples in the code-sandbox to match version 4.0.0 =(
So the idea is to wrap the chart component in a relative div and place whatever you want on the chart using absolute position.
<div className={styles.container}>
<Chart height={300} width={600}>
<AreaSeries data={data}/>
</Chart>
<div className={styles.legend}>{legend}</div>
</div>
.container {
position: relative;
}
.legend {
position: absolute;
left: 12px;
top: 12px;
z-index: 1;
font-size: 12px;
line-height: 18px;
font-weight: 300;
}
For example, see here: https://tradingview.github.io/lightweight-charts/tutorials/customization/finishing-touches![image](https://github.com/trash-and-fire/lightweight-charts-react-wrapper/assets/126291407/00564708-0373-4ae6-b561-844bb83f7e3f)