Closed tannerneuro closed 2 years ago
Hello and thanks for logging this request. It's on our radar and we will have it in mind for our new features.
Hello @tannerneuro!
Sorry for the long wait but with our new v2.2.0 release, we have added a new getData()
method which might be able to resolve your problem. Can you please confirm this so we can close this issue?
I'm closing this issue as it's resolved by the getData
method in v2.2.0 as Angus mentioned ⬆️
The output of the method for a chart with no data would be:
{
documents: []
fields: <the fields of the charts - axes, groups, etc - depending on the chart type>
}
You can also see the method's usage in this example here: Unauthenticated Charts Example
I have a chart that can have filters applied that will result in no data being returned. (An empty chart) I'd like to have the flexibility to manage that empty state after the chart renders.
Upon rendering the chart, the promise should return if data is present or not. Alternatively, a getChartData method could be applicable after rendering the chart.
The alternative is probably just grabbing this existing data and aggregating/filtering to whatever the given chart data is supposed to look like. Its just overkill to have to grab that data when the chart should have it.