multiselect-react-dropdown icon indicating copy to clipboard operation
multiselect-react-dropdown copied to clipboard

Different colours of chips based on index and colour array

Open jonccooke opened this issue 4 years ago • 2 comments

Hi,

Is there anyway to have the chips be of different colours based on the position in the selected list and an array of colours as in input?

I want this dropdown to be show the selected series on a chart and I need the chip background colour to be the same as the series graph

jonccooke avatar Dec 05 '19 14:12 jonccooke

Can you provide a clear requirement for all scenarios and sample JSON format for the same?

srigar avatar Dec 06 '19 03:12 srigar

What I done so far is to create a simple Graph in recharts and the user adds series via this drop down, which recharts renders each series in a different colour. Each series is a column in a dataset.

image

This is the current implementation. I to be able to have the first selected entry background chip (address_id ) to be same colour as the dots (Red) and the second chip (Store_id) to be green. Something like this: image

This could be done initially simply first by allowing the css json to have multiple colours for the background entry e.g.

{
 chips: 
{ 
	background: red, blue, black ....;
 }
....

or a more sophisticated implementation such as

{
   chips:
   {
      background-color-callback : callback;
   }
}

callback(selectPosition)
{
return colours[selectPosition];
}`

I hope that makes sense?

jonccooke avatar Dec 06 '19 15:12 jonccooke