
MatrixSeries custom color for each value
This discussion was imported from CodePlex
everytimer wrote at 2013-07-22 22:48:
I need to modify the MatrixSeries class for being able to select a color for each value, or at least for each cell. Does anyone know how to do that? Thanks
everytimer wrote at 2013-07-22 22:59:
Ok, OxyPlot is pretty awesome once again. It was pretty simple, you just need to change one line of code:
if (this.image == null)
{
var pixels = new OxyColor[m, n];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
var c = OxyColor.FromHsv(Matrix[i,j], 0.8, 0.8);
//pixels[i, j] = Math.Abs(this.Matrix[m - 1 - i, j]) <= this.ZeroTolerance ? OxyColors.Transparent : this.NotZeroColor;
pixels[i, j] = Math.Abs(this.Matrix[m - 1 - i, j]) <= this.ZeroTolerance ? OxyColors.Transparent : c;
}
}
this.image = OxyImage.PngFromArgb(pixels);
}
Customer support service by UserEcho