# TimeSeries Chart and timeRange

**URL:** <https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 22, 2022, 12:55pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212 "2022-07-22T12:55:53Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 22, 2022, 12:55pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/1 "2022-07-22T12:55:53Z")

</div>

In Perspective, I wonder if is possible to set the labels in of the timeAxis in a TimeSeries Chart in a fixed mode… My chart shows the power during 1 single day, so I want to have the timeAxis label every 3 hour and not that they change dynamically.

Thanks for the help

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2022, 3:57pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/2 "2022-07-25T15:57:28Z")

</div>

Any idea guys? Thank you

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [July 25, 2022, 4:13pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/3 "2022-07-25T16:13:47Z")

</div>

> [@Aiasa21](#):
>
> Any idea guys?

Hmmm. I haven't tried to use it before. I can't see how you can do what you want.  
Why did you choose the Time Series rather than the XY Chart?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2022, 5:23pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/4 "2022-07-25T17:23:18Z")

</div>

There is no way to force the tick marks to always indicate the same hour (aside from always providing the same time range.

The value of the tick marks is dictated based on the number of ticks, the format used for them, and the time range provided.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2022, 6:28pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/5 "2022-07-25T18:28:58Z")

</div>

Thanks for the answer, it’s a pity… I collect data of power consumption every hour of every day and should be nice having the 24hours fixed and seen the chart that fills up during the day.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2022, 6:30pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/6 "2022-07-25T18:30:48Z")

</div>

There’s no particular reason, I just start with it just to play and the Time Series Area is quite nice, but I can think to change if is necessary.

Here’s how it looks like:  
 ![Annotation 2022-07-25 203016](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/38c28f52274031ad3410a6533c94c68cb637e2b9.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2022, 6:35pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/7 "2022-07-25T18:35:03Z")

</div>

Theoretically, it could be done, but you would probably have to use a script transform to make it work with the TimeSires chart. Probably wouldn't be the most performant thing either.

I think the XY Chart may be a better fit as far as allowing for a fixed set of tick marks. That or a 3rd Party module may have something that you could use.

See here for an example:

> [@KyvisLabs ApexChart Module](https://forum.inductiveautomation.com/t/kyvislabs-apexchart-module/55263):
>
> Hello All, We have been working on a few modules lately, one of them being an Apex Charts module. We have been using this module for certain clients for the last few months, and in a few home automation systems, mine included. We will be releasing the source code for these modules in the coming weeks, just working on a website and the github. Commercial support is also available through an integration partner. There are a few variants in the component tree already, and I can answer any que…

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2022, 6:48pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/8 "2022-07-25T18:48:52Z")

</div>

@lrose , I’ve just add the module, it looks amazing. I play a little bit and I let you know, first of all I’ve to figure out how to set the Yaxis in autorange 😃

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2022, 8:35pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/9 "2022-07-25T20:35:34Z")

</div>

I’m trying to use ApexChart, but I find problem setting the Xaxis fixed from 00:00 to 24:00.

The data chart are correct as it was with the TimeSeries chart, but the X axis labels are not shown. I set the type as “datetime” and the min and max as in picture.

Can I ask here or is better if I open a new topic specific?

 ![Annotation 2022-07-25 223417](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99c5586bb128771b0c0c44b84289a52524365ce6.jpeg)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2022, 10:46pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/10 "2022-07-25T22:46:38Z")

</div>

You can ask here as it’s related to the same issue. I don’t actually have the module (yet) so I’m not real sure.

@kyvislabs

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 26, 2022, 8:18am UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/11 "2022-07-26T08:18:52Z")

</div>

ok thanks.

I know that you don’t use the module, but I take this opportunity to ask one (probably) stupid thing that I can’t understand. I’m inserting all the objects, values ecc manually, but I see everywhere that they put the code directly and it looks better to manage… For example like this:

```auto
{
  "chart": {
    "animations": {
      "enabled": true,
      "dynamicAnimation": {
        "speed": 1000
      },
      "easing": "linear"
    },
    "toolbar": {
      "show": false
    },
    "zoom": {
      "enabled": false
    },
    "id": "realtime"
  },
  "dataLabels": {
    "enabled": false
  },
  "stroke": {
    "curve": "smooth",
    "colors": [
      "#4E93EF"

```

I can’t understand where I could write the code

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 26, 2022, 7:24pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/12 "2022-07-26T19:24:19Z")

</div>

@nminchin, hi Nick, I’ve just red here “[KyvisLabs ApexChart Module - #13 by kyvislabs](https://forum.inductiveautomation.com/t/kyvislabs-apexchart-module/55263/13)” that you solve this problem

1. How would I show labels for particular dates/times instead? e.g. only show labels for every hour or every 6 hours?

Could you help me please? I would like to do the same but I’m struggling even to show the exactly Xaxis as I said above.  
And maybe you could answer to my question about using the code to setup the chart instead of inser all the objects manually.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 28, 2022, 9:37am UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/13 "2022-07-28T09:37:11Z")

</div>

I’ve just realized that I install the versione 1.0.0 … As soon as is possible I will update with 1.0.9, could be this the problem?

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [July 28, 2022, 8:16pm UTC](https://forum.inductiveautomation.com/t/timeseries-chart-and-timerange/62212/14 "2022-07-28T20:16:52Z")

</div>

> [@Aiasa21](#):
>
> In Perspective, I wonder if is possible to set the labels in of the timeAxis in a TimeSeries Chart in a fixed mode… My chart shows the power during 1 single day, so I want to have the timeAxis label every 3 hour and not that they change dynamically.
> 
> Thanks for the help

Short version, I use a script transform on my data from a query and I set the format for my time series chart size that doesn't change.

Longer version:

I use a query that feeds data points by a set time range, but if I get 0, it doesn't give me a data point.

So what I did, I have a set size and a set expectation of how many points I will have when I constructed the chart.

Then for the data, I do a script transform that appends zero values for datapoints I don't have.

For me, I always have 60 "data points" for my chart. I append zeros when I don't have real data points from my query.
