Open dingjunweibjkanyun opened 9 months ago
i think the main reason i left out style opts like width or stroke/fill is that some can be callbacks and it's kinda weird to redefine the callback (some of them are internally cached...though i don't think these are).
for style related changes you can always mutate and redraw, which is how i've done it:
u.series[1].stroke = 'orange';
u.redraw();
you can also have
let myStroke = 'red';
let opts = {
series: [
{},
{
stoke: () => myStroke,
}
]
}
// then...
myStroke = 'orange';
u.redraw();
setSeries was meant for more complex stuff that required multiple internal (or unknown/auto) state changes. e.g. show
can actually auto-toggle axes visibility, it can trigger rescaling & path rebuilding, changes legend styling, etc.
i guess the above mutation strategy would not affect the legend, which is in the DOM, and the styles are only set at initialization time :thinking:. you'd have to also mutate the legend's items style directly in DOM, which is more gross.
i'll think about it.
tks very much
When can we support it?