How to apply linear gradient for a text block?

hi,
Is there any way to apply linear gradient for a text block, would you send us a sample code?

Linear gradients are described by Brush objects. There are examples at GoJS Shapes -- Northwoods Software. The default gradient is vertical; you can change the direction by setting the Brush.start and Brush.end Spots.

Then you can apply such a brush to text by either setting TextBlock.stroke or TextBlock.background, depending on what effect you want.