Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PieCharts and Barcharts from numeric fields in document #2074

Open
delcacho opened this issue Sep 27, 2022 · 2 comments
Open

PieCharts and Barcharts from numeric fields in document #2074

delcacho opened this issue Sep 27, 2022 · 2 comments

Comments

@delcacho
Copy link

delcacho commented Sep 27, 2022

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
Copy link
Author

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" }
}
})}

@SavvyShah
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants