reactivesearch icon indicating copy to clipboard operation
reactivesearch copied to clipboard

PieCharts and Barcharts from numeric fields in document

Open delcacho opened this issue 3 years ago • 2 comments

Affected Projects ReactiveChart

Is your feature request related to a problem? Please describe. Trying to create visualizations out of an index

Describe the solution you'd like It would be nice to be able to create PieCharts and BarCharts not only from counts but by representing a numeric field of a document. Right now they can only be generated out of keyword counts.

Additional context

delcacho avatar Sep 27 '22 12:09 delcacho

I have noticed I can use a custom defaultQuery to retrieve a numeric field, what I would need is to have a labelField independent of the dataField:

defaultQuery={(value, props) => ({ "query": { "exists" : { "field" : "duration" } } })}

delcacho avatar Sep 27 '22 13:09 delcacho

You can use setOption prop as a functon to customize charts like setting labels. Demo for setting labels. Here is a demo which uses defaultQuery and setOption together. You can also find setOption in the docs.

SavvyShah avatar Nov 07 '22 11:11 SavvyShah