react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

Ability to set an active data point

Open georgesakourishan opened this issue 10 years ago • 6 comments

I have a bar graph that looks like the below image. The current color scheme only allows for one color to be chosen for all the bars; whereas I would like to set a color for an active bar and another color for the rest. Please let me know if this is currently doable!

image

georgesakourishan avatar Nov 08 '16 22:11 georgesakourishan

Hey @greatermeans I've generally found myself doing this by wrapping the chart in a stateful component that has a notion of "selected bar", using colorType='literal' for the color scale, and then modifying the data

mcnuttandrew avatar Nov 16 '16 18:11 mcnuttandrew

@mcnuttandrew thanks for the response, do you have an example by any chance?

georgesakourishan avatar Nov 16 '16 18:11 georgesakourishan

I have one in an upcoming PR, something like this https://github.com/uber/react-vis/blob/mouse-out-radial/src/example/radial-chart/custom-radius-radial-chart.js but for barchart?

mcnuttandrew avatar Nov 16 '16 19:11 mcnuttandrew

@mcnuttandrew awesome dude, was able to replicate!

georgesakourishan avatar Nov 16 '16 20:11 georgesakourishan

Dope! It's generally my opinion that sort of state maintaince is the job of the wrapping application, so i'm gonna close this issue as a wont fix? Feel free to re-open if you disagree

mcnuttandrew avatar Nov 16 '16 21:11 mcnuttandrew

@mcnuttandrew fine to close. This worked on stackedbarchart and barchart. For some reason, LineMarkSeries doesn't respond to opacity. If you have any suggestions, please let me know!

georgesakourishan avatar Nov 16 '16 21:11 georgesakourishan