update switching fr logic for expected alpha
This commit is contained in:
@@ -36,10 +36,12 @@ async function update_tv(data_list, lookback_max_points) {
|
||||
|
||||
|
||||
async function create_tv(charts_list, create_chart_options) {
|
||||
const container = document.getElementById('tv');
|
||||
|
||||
if (create_chart_options.crosshair == 'NORMAL') {
|
||||
create_chart_options.crosshair = { mode: LightweightCharts.CrosshairMode.Normal }
|
||||
};
|
||||
window.chart = LightweightCharts.createChart(document.getElementById('tv'), create_chart_options);
|
||||
window.chart = LightweightCharts.createChart(container, create_chart_options);
|
||||
window.charts_arr = [];
|
||||
|
||||
charts_list.forEach(function (item, index) {
|
||||
@@ -64,7 +66,18 @@ async function create_tv(charts_list, create_chart_options) {
|
||||
});
|
||||
|
||||
window.chart.timeScale().fitContent();
|
||||
|
||||
|
||||
// Handle responsiveness: Resize chart when container size changes
|
||||
const resizeObserver = new ResizeObserver(entries => {{
|
||||
for (let entry of entries) {{
|
||||
window.chart.applyOptions({
|
||||
width: entry.contentRect.width,
|
||||
height: entry.contentRect.height
|
||||
});
|
||||
}}
|
||||
}});
|
||||
resizeObserver.observe(container);
|
||||
|
||||
console.log("TV Created!")
|
||||
|
||||
// window.midPriceLine_Config = {
|
||||
|
||||
Reference in New Issue
Block a user