You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by El Even <7a...@gmail.com> on 2023/03/24 11:32:24 UTC

Question about scatter chart interval

Hi,

I’m using the scatter chart and I want to set a specific interval.

Here is an example data array :
[09:45:00,0.26780000000000653,13.390000000000327,9,45,0]

This is its signification.
[time (unix time formatted in hours, minutes, seconds), price, value, hour, minutes, seconds]

For the xAxis I’m using ‘category’, but I can also use time if needed.

Here is the result:
[cid:image001.png@01D95E4C.5727ECA0]

Now, I would like to achieve the following.

  *   On the xAxis, I would like it to start at 08:00:00
  *   On the xAxis, I would like a 15 minutes interval. So the xAxis would be 08:00:00, 08:15:00, 08:30:00, etc.

I’ve tried with interval, maxInterval, minInterval, etc. and also changing type from ‘category’ to ‘time’ but I cannot achieve this. Can you please tell me how I can achieve this ?

Thank you





Re: Question about scatter chart interval

Posted by Zhongxiang Wang <wa...@apache.org>.
Hi,

I'm sorry for the late reply.

I think you have did the right attempt. In my opinion, it should have been
working by setting `minInterval` and `maxInteval`. But in fact, it seems we
have to add a tiny offset for the timestamp interval to make the time axis
split in our expected way. See the following demo [1].

I'm not sure about this, so let's see if *Ovilia* has some information that
can help you.

[1]
https://echarts.apache.org/examples/editor.html?code=MYewdgzgLgBAJgQygUxgXhgcgEwAZsDMAtLsdgJyYDcAUKJLNAgE5QAiSqGHKAdAA4sIyABSIUASlr1o8JAnQwwyAO4wAgs2YIAniICMuKTRoAzEMxgiANslgBLRbgA0MW2EXiEvdwHMoABZUMI4APG7IYMH2ANQxEjAA3jQwclAIANr2ALqKGSmpMAD0RTDaYHAgALZpyAWpIo5ozTC4MAD8MEysPKgAXGmZjkQw-tkZuNkJMTAAfrMiALJIAbzllVUiCQBUMARtuwBsB6O4ZxLO9cWl69Uw_Mz2wHWFcwvLgWsIFdVbMLuGIyXV4lMrfDYwABuCGsAFcXoV5ksVl8fpsdqcjAVsrQAL4mED8KD2cCKZKpAAe6gp9ggA3JhSgOn4yAGmGJVWQmGBhVB3VgSFaAA4-mdRbgrlV7GABr0BEJROJUDNMMLxeLMBdJdKAJJgFDMaHWAb6ACs_xgxwt-mQBBgMxtRCFrlBCmJYB0MBAplMwigrilvgCsAARqgFCHYb5JQgKXqDUaTeajicbXaHcgnTzUrHaQAZBBh41JK6pczMKpIA1sxIACVruL6iSqVUbiQgEFxmCu-NSuJ5OmptPpVyZLLZRvh3b7PN8jzgI9eIZAUCg1RNZwK_YKXgAWiB1yXXmPWVgINZ7HBkMxuVdrIXkNYAGIWSur68iDnIBIM17MOywswHjIMAAQsFAEC8F-vDlm-n72JyriYHWDZNi2XbGK8vYwNuqTCI8yB0jA-SvL-hRgAgnJsk-CAANaoDwCC3q8qQnmyEDAFW17MSxXgDF4PbYjQuJUEAA

On Sat, Mar 25, 2023 at 12:01 AM El Even <7a...@gmail.com> wrote:

> Hi,
>
>
>
> I’m using the scatter chart and I want to set a specific interval.
>
>
>
> Here is an example data array :
>
> [09:45:00,0.26780000000000653,13.390000000000327,9,45,0]
>
>
>
> This is its signification.
>
> [time (unix time formatted in hours, minutes, seconds), price, value,
> hour, minutes, seconds]
>
>
>
> For the xAxis I’m using ‘category’, but I can also use time if needed.
>
>
>
> Here is the result:
>
>
>
> Now, I would like to achieve the following.
>
>    - On the xAxis, I would like it to start at 08:00:00
>    - On the xAxis, I would like a 15 minutes interval. So the xAxis would
>    be 08:00:00, 08:15:00, 08:30:00, etc.
>
>
>
> I’ve tried with interval, maxInterval, minInterval, etc. and also changing
> type from ‘category’ to ‘time’ but I cannot achieve this. Can you please
> tell me how I can achieve this ?
>
>
>
> Thank you
>
>
>
>
>
>
>
>
>