OxyPlot C#中的使用经验
类似Surfer的彩虹色标
// 彩虹色标
OxyColor[] rainbowColors = new OxyColor[7];
rainbowColors[0] = OxyColor.FromRgb(139, 0, 0); //darkRed
rainbowColors[1] = OxyColor.FromRgb(255, 0, 0); //red
rainbowColors[2] = OxyColor.FromRgb(255, 255, 0);
rainbowColors[3] = OxyColor.FromRgb(0, 255, 0);
rainbowColors[4] = OxyColor.FromRgb(0, 255, 255);
rainbowColors[5] = OxyColor.FromRgb(0, 0, 255);
rainbowColors[6] = OxyColor.FromRgb(0, 0, 139); //darkBlue
// 反向
// rainbowColors = rainbowColors.Reverse().ToArray();
var numberOfColors = freCount;
var myRainbow = OxyPalette.Interpolate(
numberOfColors,
rainbowColors);
图形注解
点注解:
var pointAnnotation = (new PointAnnotation
{
X = x,
Y = y,
Size = 2,
Fill = OxyColors.Blue,
// Text = text
});
this.plotView1.Model.Annotations.Add(pointAnnotation);
折线注解:
// 线的情况
PolylineAnnotation polylineAnnotation = new PolylineAnnotation { };
listGridPoint.ForEach(gridPoint =>
{
var x = gridPoint.x;
var y = gridPoint.y;
DataPoint dp = new DataPoint(x, y);
polylineAnnotation.Points.Add(dp);
});
this.plotView1.Model.Annotations.Add(polylineAnnotation);
标签:OxyPlot,经验,rainbowColors,OxyColor,FromRgb,使用,var,new,255
From: https://www.cnblogs.com/lvye1221/p/17160569.html