Yes, I can reproduce the problem. The problem is that once you call updateSettings()
with the data: {sortField: "xxx"}
it actually merges these settings together with the original object (that contain preloaded
) and then mark the data source as modified so that it is recreated.
Unfortunately at this point the data source is recreated thus losing the values from the replaceData()
call which only affected the internal cache of the original data source.
I will think about it but I suspect that we won't be easily able to support this properly because of how the chart internals work.
In the meantime if you could track the last data from the last call to replaceData()
yourself you could pass that into sort as well:
f.updateSettings({
data: {
sortField: "value",
preloaded: data1
}
});
While at first this seems to be the way of handling this within the library itself, there might be some issues in some case when dataFunction
or url
is used (perhaps even together with preloaded
at the same time).