I have a curious issue with the offset in the Apexcharts.
My goal:
I get data from a satellite 1.5 million km from earth. What the satellite measures arrives at earth approximately 45 min later, but I use a formula to calculate that.
In my Apexchart I place the now markerline this ~45min back by use a positive offset with a template on the span. That works seamless.
Now all the data in the series need to be adjusted with a negative offset of the same value.
When I type in the value in the offset at the series eg â-45minâ it works exactly as it should. but when I use the same template as I use for the span offset it doesnât work.
Anyone having a brilliant idea to solve this?
I am not sure if I get all of this bu why not âoffsetâ the series themselves?
Example: I have a forecast that should (!) be at noon but arrives at 01:00 in the morning with that timestampâŚso I just offset it with +11h and then it fits the timeline again
Thanks for your response. That is correct what you say.
If you look at the code you see that I have an offset at the series (âall_series_configâ)
The issue is that it works when I fill in â-45minâ or â-1hâ. Then I see the graphs shifting on the x-axis.
However when I put a template in there, like you see now in the code, it doesnât have any effect. Strange enough the template does work when you use it in the span offset (see also code above)
I am suimng templates inside a config-template-card or config-templater (2 card are av.)⌠do you do the same thing? Use of templates is not always available everywhere
It looks indeed that templates are not available for everything. What just caused my curiosity that the templating works in one section of the Apexcharts and not in another section.
As promised I would give some feedback on the solution with config-template-card.
I found out that also then you can not use formulas to calculate a value for a variable. But ofcourse you can use sensor data to have that as variable and use it in the apexcharts.
So I decided to create a sensor âsensor.solar_travel_timeâ that calculates the value via a template. The value of this new sensor is read into a variable âoffsetâ and used as offset value in the apexchartsâ span and all_series_config.
This works like a charm.
Next steps is optimizing the graph layout and find a way to present scientific notations at the y-axis as it now blows displaying values like 10000000.
Collecting data now and will post a screenshot when it looks pretty.
Great⌠you can do all sorts of nice stuff with these cards, I have f.e. a card that uses input number to set an offset so I can compare to day with e.g. 1.2.3.4 etc. days back (e.g. for energy consumption, weather, etc.
This is how it now looks like. Because communication to the satellite (1.5 km from earth) sometimes fails, there are some gaps in the data.
Basically at the right is what is now observed by the satellite. The marker earth is where the solar wind reached earth (in this example it is 67 min later)
One pity is that the nightstate can not be displayed in an graph where a logarithmic scale is used. The same happens in the mini-graph. When logarithmic scales are used it can only display lines.