How to set StateChart linkdataarray colors?

Hi.

I’m using go js stateChart(http://gojs.net/latest/samples/stateChart.html).

I need linkdataarray set color. How to set link color?

I’m trying => { “from”: 1, “to”: 4, “text”: “timer”, “color”, “red” } but not working. Not set a color.

Can you help me?

First, are you debugging your code? There is a syntax error in your JavaScript object.

Second, do you have a Binding on the link’s Shape.stroke property to the data’s “color” property?

Hi, thank you for your answers

First, there is no JavaScript error in my code.
Second, Shape.stroke property every place is the same color paint.
But I need a different color paint.

I want to use the json linkdataarray object.

Is it possible?

That’s what Bindings are for. Read http://gojs.net/latest/intro/usingModels.html and http://gojs.net/latest/intro/dataBinding.html.

And look at http://gojs.net/latest/samples/basic.html, which data-binds link colors.

hi walter.
Thanks for reply.

I do what I want.

For node template color: , new go.Binding(“fill”, “color”)
For link template color: ,new go.Binding(“fill”, “color”)

thanks you.

Hi walter

How i change TextBlock color:

      $(go.TextBlock,
              {
                  font: "bold 8pt helvetica, bold arial, sans-serif",             
                  color: "red",
                  editable: true  
              },

color: "red " did not work.

There are at least two properties of TextBlock that you can set or bind: background and stroke.
http://gojs.net/latest/intro/textBlocks.html

Thank you for your reply.

good work.