We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I request data from my API to display them on the graph, the debug shows that I am getting my data well but nothing on the graph:
My actual test code:
<template> <span> <trading-vue ref="tvjs" title-txt="ETHUSDT Binance 1h" :data="chart" :width="width" :height="height" :overlays="overlays"> </trading-vue> </span> </template> <script> import TradingVue from 'trading-vue-js' import { DataCube } from 'trading-vue-js' const SM = `http://localhost:7000/binder` export default { name: 'app', components: { TradingVue }, computed: {}, mounted() { window.addEventListener('resize', this.onResize) this.onResize() this.load_bind().then(data => { this.chart = new DataCube({ ohlcv: data['chart.data'], onchart: [], offchart: [], datasets: [] }, { aggregation: 100 }) this.chart.onrange(this.load_bind) this.$refs.tvjs.resetChart() }) }, methods: { onResize(event) { this.width = window.innerWidth this.height = window.innerHeight }, async load_bind() { try { let r = await fetch(SM).then(r => r.json()) console.log('datas RealManager') console.log({'chart.data': this.parse_datas(r)}) return {'chart.data': this.parse_datas(r)} } catch (error) { console.log(error); } }, parse_datas(data) { if (!Array.isArray(data)) return [] return data.map(x => { for (var i = 0; i < x.length; i++) { x[i] = parseFloat(x[i]) } return x.slice(0,6) }) } }, beforeDestroy() { window.removeEventListener('resize', this.onResize) }, data() { return { chart: {}, overlays: [], } } } </script>
My setup is correct, i have test with the DataHelper example, it work correctly :) Anyone have an idea to debug this ? I forgot something ?
Thanks.
The text was updated successfully, but these errors were encountered:
trading-vue works absolutely fine. This is a problem with your code, not with trading-vue. . thus not a trading-vue issue .. its a 'your code' issue.
Sorry, something went wrong.
No branches or pull requests
Hi,
I request data from my API to display them on the graph, the debug shows that I am getting my data well but nothing on the graph:
My actual test code:
My setup is correct, i have test with the DataHelper example, it work correctly :)
Anyone have an idea to debug this ? I forgot something ?
Thanks.
The text was updated successfully, but these errors were encountered: