Plot exposes data, colors, title, caption and friends, but nothing for vars/. Every var write goes through api_create plus four api_write calls:
p.api_create("/vars/min-days")
p.api_write("/vars/min-days/format", ",.0f")
p.api_write("/vars/min-days/type", "number")
p.api_write("/vars/min-days/about", "Days until the soonest expiry")
p.api_write("/vars/min-days/value", "70")
Order matters as well: format has to exist before value, because the formatted text is computed at the moment the value lands. Get it backwards and the var renders with whatever default it was created with. Nothing in the SDK hints at that.
Something like p.vars["min-days"] = 70, with optional format/type/about, would cover the common case. Since vars are the natural way to put KPIs next to a chart, they feel like they belong in the typed surface rather than in raw path writes.
Plotexposesdata,colors,title,captionand friends, but nothing forvars/. Every var write goes throughapi_createplus fourapi_writecalls:Order matters as well:
formathas to exist beforevalue, because the formatted text is computed at the moment the value lands. Get it backwards and the var renders with whatever default it was created with. Nothing in the SDK hints at that.Something like
p.vars["min-days"] = 70, with optional format/type/about, would cover the common case. Since vars are the natural way to put KPIs next to a chart, they feel like they belong in the typed surface rather than in raw path writes.