<lvc:LineSeries><lvc:LineSeries.Stroke><LinearGradientBrush StartPoint=\"0,0\" EndPoint=\"0,1\"MappingMode=\"RelativeToBoundingBox\" Opacity=\"0.8\"ColorInterpolationMode=\"ScRgbLinearInterpolation\"SpreadMethod=\"Pad\"><GradientStopCollection><GradientStop Color=\"Red\" Offset=\"0.1\"></GradientStop><GradientStop Color=\"Green\" Offset=\"0.1\"></GradientStop><GradientStop Color=\"Green\" Offset=\"0.9\"></GradientStop><GradientStop Color=\"Red\" Offset=\"0.9\"></GradientStop><GradientStop Color=\"Red\" Offset=\"1\"></GradientStop></GradientStopCollection></LinearGradientBrush></lvc:LineSeries.Stroke></lvc:LineSeries>
第二行的Green offset = 0.1是为了终结第一行Red的渐变效果,同理第四行的 Red offset = 0.9 可以终结第三行Green渐变到Red的效果。
效果如图