echarts icon indicating copy to clipboard operation
echarts copied to clipboard

xAxis interval option not works with timeseries line graph

Open HiroyukiYANO opened this issue 4 years ago • 5 comments

Version

5.0.2

Reproduction link

https://jsfiddle.net/sgLp5mqu/3/

Steps to reproduce

Just run jsfiddle then you can find that the graph interval is not set at above (timeseriese) graph. I expect 1hour interval(3600000 millisec), however, the result is 4hour interval.

This option is work at exactly same scripts with escharts ver 4.8.0, as you can see below. https://jsfiddle.net/29r8qdcf/4/

What is expected?

The xAxis interval option with timeseriese works file as same as ver 4

What is actually happening?

I don't know what is happening in the code, correctly.

HiroyukiYANO avatar Feb 20 '21 07:02 HiroyukiYANO

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

echarts-bot[bot] avatar Feb 20 '21 07:02 echarts-bot[bot]

Similar to #14298 . interval is a reference value and is not used compulsorily. Currently, we have no way to accurately set the interval of time axis but this seems to be a frequently asked feature. Further discussion is required on this topic.

Ovilia avatar Feb 22 '21 04:02 Ovilia

I need to set interval like I add interval of 4 or more years then chart should show axis label after that time period without any other gap like leap or any.

I have added this to get interval of 4 years but due to leap year or any other its shows 1 day difference, and I want to show accurate difference in axis.

interval:new Date(1974, 0, 1, 0, 0, 0, 0).getTime(),

Please consider the below example for this above implementation. http://jsfiddle.net/d7e09r5t/275/

Arraz avatar Feb 22 '21 06:02 Arraz

it should be the same as type 'value' for xAxis, such as

option = {
    xAxis: {
        type: 'value',
        min: 0,
        max: 24,
        interval: 3,
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: [[0, 3], [12, 5], [24, 3]],
        type: 'line'
    }]
};

but it does not work for 'time' type:

const min = new Date('2021-02-01 00:00:00');
const middle = new Date(min.getTime() + 12 * 3600 * 1000);
const max = new Date(min.getTime() + 24 * 3600 * 1000);

option = {
    xAxis: {
        type: 'time',
        min,
        max,
        interval: 3 * 3600 * 1000,
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: [[min, 3], [middle, 5], [max, 3]],
        type: 'line'
    }]
};

the interval has no use for xTick after upgrading to v5.

lahvey avatar Feb 26 '21 02:02 lahvey

I add one to this, also need interval on time axis, but it does not work.

Lovor01 avatar Feb 07 '24 00:02 Lovor01