Trading View API 较小时无法在价格尺度上显示价格
Trading View API is not able to show the price on price-scale when it's small
查看我的 OHLC Data 以使用交易视图绘制烛台 API。
我正在使用这个 HTML 和脚本来绘制数据:
<!DOCTYPE html>
<html>
<head>
<title>Plot</title>
<script src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script>
</head>
<body>
<script type="text/javascript">
const chart = LightweightCharts.createChart(document.body, { width: 1200, height: 600 });
const lineSeries = chart.addLineSeries();
chart.applyOptions(
{
timeScale: {
rightOffset: 12,
timeVisible: true,
secondsVisible: false,
fixLeftEdge: false,
},
}
);
let candl_data = [my_OHLC_data]
const candlestickSeries = chart.addCandlestickSeries();
// set data
candlestickSeries.setData(candl_data)
</script>
</body>
</html>
看看它是如何显示的:
如何才能显示全价?
拉克什。
迟到总比不到好。
您需要在设置中指定价格精度。 Demo
const candlestickSeries = chart.addCandlestickSeries({
priceFormat: {
type: 'price',
precision: 10,
minMove: 0.0000000001,
},
});
查看我的 OHLC Data 以使用交易视图绘制烛台 API。
我正在使用这个 HTML 和脚本来绘制数据:
<!DOCTYPE html>
<html>
<head>
<title>Plot</title>
<script src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script>
</head>
<body>
<script type="text/javascript">
const chart = LightweightCharts.createChart(document.body, { width: 1200, height: 600 });
const lineSeries = chart.addLineSeries();
chart.applyOptions(
{
timeScale: {
rightOffset: 12,
timeVisible: true,
secondsVisible: false,
fixLeftEdge: false,
},
}
);
let candl_data = [my_OHLC_data]
const candlestickSeries = chart.addCandlestickSeries();
// set data
candlestickSeries.setData(candl_data)
</script>
</body>
</html>
看看它是如何显示的:
如何才能显示全价?
拉克什。 迟到总比不到好。 您需要在设置中指定价格精度。 Demo
const candlestickSeries = chart.addCandlestickSeries({
priceFormat: {
type: 'price',
precision: 10,
minMove: 0.0000000001,
},
});