question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add startValue and endValue parameters in zoom event triggered by slider

See original GitHub issue

What problem does this feature solve?

When user uses slider to zoom the chart, the event triggered does not have parameters startValue and endValue. It only has start and end percentage values.

What does the proposed API look like?

Version

4.2.1

Reproduction link

https://www.echartsjs.com/examples/en/editor.html?c=line-simple

Steps to reproduce

  • Please copy the following code into input on the left side.
option = {
    title: {
        text: 'ECharts 入门示例'
    },
    tooltip: {},
    legend: {
        data:['销量']
    },
    xAxis: {
        data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
    },
    yAxis: {},
    series: [{
        name: '销量',
        type: 'line',
        data: [5, 20, 36, 10, 10, 20]
    }],
    dataZoom: [
        {
            type: 'slider',
            show: true,
            realtime: false
        },    
    ]
};

myChart.on('dataZoom', function (params) {
    console.log(params);
    
    // should return exact values, but returns undefined
    console.log(params.startValue);
    console.log(params.endValue);
});
  • Then try to zoom the chart and have a look at console.

What is expected?

As described in the docs, datazoom event includes startValue and endValue in the payload if the event is triggered by using toolbox. But I think the datazoom event (triggered by the slider) should also take parameters startValue and endValue besides start and end percentage parameters.

What is actually happening?

startValue and endValue parameters are not included in the payload of the event.

Thank you.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
DhrubajitPCcommented, Mar 5, 2020

+1 any updates on this?

honestly, the solution at https://stackoverflow.com/questions/42503988/echarts-datazoom-event-does-not-return-timestamp-but-only-percentages/43910746#43910746 feels like an unnecessary workaround

1reaction
umutcanbolatcommented, Jun 20, 2019

Hi @Ovilia! I’m already aware of this note. My purpose is to see the same values not only in datazoom event triggered by toolbox, but also in the event triggered by the slider.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting values instead of percentages of dataZoom in Apache ...
In the event I receive 'start' and 'end' as percentages, but what I would like to receive are the actual start and end...
Read more >
[GitHub] [incubator-echarts] derekflint commented on issue #10700 ...
[GitHub] [incubator-echarts] derekflint commented on issue #10700: add startValue and endValue parameters in zoom event triggered by slider.
Read more >
Using Webinar practice session - Zoom Support
You can start the practice session, broadcast, and end the event hours or days ahead of the scheduled date, without impacting your ability ......
Read more >
Zooming axis via API / external scrollbar - amCharts
To zoom the chart horizontally, we would zoom out X axis. ... It takes Date objects as parameters, e.g.: TypeScript / ES6 ......
Read more >
Configure Sliders or Range Sliders - SAP Help Portal
As an application designer you can configure sliders or range sliders so that application users can input and change values dynamically and trigger...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found