mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-14 12:13:52 +00:00
Convert profitdistro chart to use computed props
This commit is contained in:
parent
159f69c141
commit
261b3fb947
|
@ -50,13 +50,15 @@ export default defineComponent({
|
||||||
console.log('setup start');
|
console.log('setup start');
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
// registerTransform(ecStat.transform.histogram);
|
// registerTransform(ecStat.transform.histogram);
|
||||||
const profits = props.trades.map((trade) => trade.profit_ratio);
|
|
||||||
// console.log(profits);
|
// console.log(profits);
|
||||||
// const data = [[]];
|
// const data = [[]];
|
||||||
|
|
||||||
const bins = 10;
|
const bins = 10;
|
||||||
const data = binData(profits, bins);
|
const data = computed(() => {
|
||||||
console.log(profits, data);
|
const profits = props.trades.map((trade) => trade.profit_ratio);
|
||||||
|
|
||||||
|
return binData(profits, bins);
|
||||||
|
});
|
||||||
|
|
||||||
const chartOptions = computed((): EChartsOption => {
|
const chartOptions = computed((): EChartsOption => {
|
||||||
const chartOptionsLoc: EChartsOption = {
|
const chartOptionsLoc: EChartsOption = {
|
||||||
|
@ -66,7 +68,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0)',
|
backgroundColor: 'rgba(0, 0, 0, 0)',
|
||||||
dataset: {
|
dataset: {
|
||||||
source: data,
|
source: data.value,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user