@bahuubali wrote:
Hi, I have nodeTemplate config below:
(go.Panel, 'Auto', { stretch: go.GraphObject.Horizontal }, (go.Shape,
{ fill: ‘#4dbd74’, stroke: null, height: 35 }),
$(go.TextBlock,
{
alignment: go.Spot.Center,
},
new go.Binding(‘text’, ‘label’))),In fill property, how can i set color’ code base on key of node, ex:
$(go.Shape,
{ fill: key===‘Alpha’ ? ‘4dbd74’ : ‘black’ , stroke: null, height: 35 }),
- nodeDataArray: [
{
key: ‘Alpha’, label: ‘Alpha’,
},
{
key: ‘Beta’, label: ‘Beta’,
},
];Thanks a lot !
Posts: 1
Participants: 1