Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
api:chart [2019/12/30 14:53] – [Chart URL for tomorrow] knutkohl | api:chart [2023/08/10 09:45] (current) – [Solar production estimate chart] knutkohl | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Solar production estimate chart ====== | ====== Solar production estimate chart ====== | ||
- | ([[:account models# | + | ([[:account models# |
You can direct draw forecast estimate charts via API calls. | You can direct draw forecast estimate charts via API calls. | ||
Line 10: | Line 10: | ||
So the process of drawing a chart consists of 3 parts: | So the process of drawing a chart consists of 3 parts: | ||
- | - Request a unique token for your plane(s), combine up to 3 (You can [[http:// | + | - Request a unique token for your plane(s), combine up to 3 (you can [[http:// |
- Init JavaScript chart functions, once per page | - Init JavaScript chart functions, once per page | ||
- Draw concrete chart by placing the JavaScript snippet exact at the place, where the chart should be shown. | - Draw concrete chart by placing the JavaScript snippet exact at the place, where the chart should be shown. | ||
Line 48: | Line 48: | ||
==== Chart URL for tomorrow | ==== Chart URL for tomorrow | ||
- | < | + | |
- | https:// | + | https:// |
- | </ | + | |
You can draw the chart **up to 6 days** in advance! | You can draw the chart **up to 6 days** in advance! | ||
+ | |||
+ | Please load the scripts **always** defered to not block the page loading! | ||
< | < | ||
<-- ---------------------------------------------------------------------- | <-- ---------------------------------------------------------------------- | ||
-- Init chart functions, required only ONCE per page | -- Init chart functions, required only ONCE per page | ||
+ | -- Put this always BEFORE the chart scripts! | ||
-- ------------------------------------------------------------------ --> | -- ------------------------------------------------------------------ --> | ||
<script defer src=" | <script defer src=" | ||
<div style=" | <div style=" | ||
- | |||
<-- ------------------------------------------------------------------ | <-- ------------------------------------------------------------------ | ||
-- Custom header | -- Custom header | ||
Line 69: | Line 70: | ||
<-- ------------------------------------------------------------------ | <-- ------------------------------------------------------------------ | ||
-- Wrap script with a DIV with dimensions to define chart size | -- Wrap script with a DIV with dimensions to define chart size | ||
- | -- The chart works perfect with deferred loading! | ||
-- -------------------------------------------------------------- --> | -- -------------------------------------------------------------- --> | ||
<div style=" | <div style=" | ||
<script defer src=" | <script defer src=" | ||
</ | </ | ||
- | |||
</ | </ | ||
</ | </ | ||
+ | ==== Parameters ==== | ||
+ | |||
+ | You can provide 2 parameters to the script: | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | You can in both parameters use the follwing placeholders: | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | If nothing is provided, no tilte is drawn and the subtitle becomes the date. | ||
+ | |||
+ | If the title contains the '' | ||
+ | |||
+ | Full example | ||
+ | https:// | ||
===== 3. Result ===== | ===== 3. Result ===== | ||
{{ : | {{ : |