Echart перетащите только точки оси Y на линейном графике - PullRequest
0 голосов
/ 20 ноября 2018

как я могу изменить точку на оси Y линии Echart

Echart Перетаскиваемый линейный график

if (!app.inNode) {
setTimeout(function () {
    // Add shadow circles (which is not visible) to enable drag.
    myChart.setOption({
        graphic: echarts.util.map(data, function (item, dataIndex) {
            return {
                type: 'circle',
                position: myChart.convertToPixel('grid', item),
                shape: {
                    cx: 0,
                    cy: 0,
                    r: symbolSize / 2
                },
                invisible: true,
                draggable: true,
                ondrag: echarts.util.curry(onPointDragging, dataIndex),
                onmousemove: echarts.util.curry(showTooltip, dataIndex),
                onmouseout: echarts.util.curry(hideTooltip, dataIndex),
                z: 100
            };
        })
    });
}, 0);
window.addEventListener('resize', updatePosition);
}

// функция для перетаскивания точки здесьфункция, написанная для перетаскивания точки

function onPointDragging(dataIndex, dx, dy) {
data[dataIndex] = myChart.convertFromPixel('grid', this.position);
myChart.setOption({
    series: [{
        id: 'a',
        data: data
    }]
});

};

...