chart config tweak
This commit is contained in:
@@ -131,6 +131,9 @@ function selectPool(fee) {
|
|||||||
|
|
||||||
export function initWidget(el) {
|
export function initWidget(el) {
|
||||||
widget = window.tvWidget = new TradingView.widget({
|
widget = window.tvWidget = new TradingView.widget({
|
||||||
|
|
||||||
|
// Widget Options
|
||||||
|
// https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.ChartingLibraryWidgetOptions
|
||||||
library_path: "/charting_library/",
|
library_path: "/charting_library/",
|
||||||
// debug: true,
|
// debug: true,
|
||||||
autosize: true,
|
autosize: true,
|
||||||
@@ -144,6 +147,13 @@ export function initWidget(el) {
|
|||||||
drawings_access: {type: 'white', tools: [],}, // show no tools
|
drawings_access: {type: 'white', tools: [],}, // show no tools
|
||||||
custom_themes: tvCustomThemes,
|
custom_themes: tvCustomThemes,
|
||||||
theme: useStore().theme,
|
theme: useStore().theme,
|
||||||
|
|
||||||
|
// Chart Overrides
|
||||||
|
// https://www.tradingview.com/charting-library-docs/latest/customization/overrides/chart-overrides
|
||||||
|
overrides: {
|
||||||
|
// "mainSeriesProperties.priceAxisProperties.log": false,
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// debug dump all events
|
// debug dump all events
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ export class OrderShapes {
|
|||||||
this.status = orderStatus
|
this.status = orderStatus
|
||||||
this.trancheShapes = []
|
this.trancheShapes = []
|
||||||
const maxAllocation = Math.max(...orderStatus.order.tranches.map((ts)=>ts.fraction)) / MAX_FRACTION
|
const maxAllocation = Math.max(...orderStatus.order.tranches.map((ts)=>ts.fraction)) / MAX_FRACTION
|
||||||
for (let i = 0; i < orderStatus.trancheStatus.length; i++)
|
if (orderStatus.trancheStatus !== undefined)
|
||||||
this.trancheShapes.push(new TrancheShapes(this.symbol, this.status, i, maxAllocation));
|
for (let i = 0; i < orderStatus.trancheStatus.length; i++)
|
||||||
|
this.trancheShapes.push(new TrancheShapes(this.symbol, this.status, i, maxAllocation));
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {for (const t of this.trancheShapes) t.show();}
|
show() {for (const t of this.trancheShapes) t.show();}
|
||||||
|
|||||||
@@ -214,9 +214,7 @@ watch(selected, async ()=>{
|
|||||||
// switch symbol
|
// switch symbol
|
||||||
deleteOrderShapes()
|
deleteOrderShapes()
|
||||||
await setSymbol(symbol)
|
await setSymbol(symbol)
|
||||||
console.log('change symbol completed')
|
|
||||||
}
|
}
|
||||||
console.log('creating order shape', id)
|
|
||||||
orderShapes[id] = new OrderShapes(symbol, status)
|
orderShapes[id] = new OrderShapes(symbol, status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,14 +226,12 @@ function deleteOrderShapes(keepSet={}) {
|
|||||||
const keys = [...Object.keys(orderShapes)]
|
const keys = [...Object.keys(orderShapes)]
|
||||||
for (const id of keys) {
|
for (const id of keys) {
|
||||||
if (!(id in keepSet)) {
|
if (!(id in keepSet)) {
|
||||||
console.log('deleting order shape', id)
|
|
||||||
orderShapes[id].delete()
|
orderShapes[id].delete()
|
||||||
delete orderShapes[id]
|
delete orderShapes[id]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const orderShapes = {}
|
const orderShapes = {}
|
||||||
|
|
||||||
onUnmounted(()=>{
|
onUnmounted(()=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user