Gradient strokes: across or along
A stroke's gradient can run across its width, along its length, or over the whole box.
Try this
- Press play. The rainbow is one path with one stroke.
- Click the rainbow, then its Stroke swatch under Shape.
- On the Gradient tab, change Placement from Across the stroke to Across the box.
- The rings below compare Across the box, Across the stroke and Along the stroke.