diff --git a/src/components/charts/CandleChart.vue b/src/components/charts/CandleChart.vue index 819fe34c..9e71f96d 100644 --- a/src/components/charts/CandleChart.vue +++ b/src/components/charts/CandleChart.vue @@ -168,6 +168,14 @@ export default class CandleChart extends Vue { opacity: 1, }, }, + // positioning copied from https://echarts.apache.org/en/option.html#tooltip.position + position: function (pos, params, dom, rect, size) { + // tooltip will be fixed on the right if mouse hovering on the left, + // and on the left if hovering on the right. + var obj = {top: 60}; + obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5; + return obj; + }, }, axisPointer: { link: [{ xAxisIndex: 'all' }],