Skip to content

How to Implement Dragging #605

Answered by rprpx
rprpx asked this question in Q&A
Discussion options

You must be logged in to vote

Vue.js 3.2.31 (using Composition API)
Echarts 5.3.0
vue-echarts 6.0.2

Objective was to create a LINE graph (details of the graph set in myOption.series[0])
that would implement dragging for the points of the graph.

The following worked for me ...

vueApp.component('echart', VueECharts);
setup() {  
    const theChartRef = Vue.ref( null );   //this is how a 'ref' is set up when using composition api

    const myOption = Vue.reactive( ... create ECharts 'option' object here ... );

    Vue.onMounted(() => {    //the following code must be run after mounting, otherwise 'theChartRef' will still be null
        //create a 'graphic' for each point in series[0]; these 'graphics' will be invisib…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rprpx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants