Hello,
When I have data that contains NaN values the IntensityGridSeries does not ignore these values when PixelRendering = false. See the screen shots with PixelRendering on and off. I would like to have PixelRendering off so that I can get the interpolation and contour lines.
I've attached a demo project and with data that shows the problem. The NaN values are in upper left corner, the areas that look like "C" and "@". FWIW these NaN areas display fine on SurfaceGridSeries3D plots.
Thanks
Greg.
NaN data in IntensityGridSeries
Moderator: Queue Moderators
NaN data in IntensityGridSeries
- Attachments
-
- LightningChartTest.zip
- (181.34 KiB) Downloaded 1249 times
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: NaN data in IntensityGridSeries
In general, don't use NaN values. LightningChart doesn't have check for them. It is up to the GPU how it handles them in specific visualization.
To make certain parts of IntensityGridSeries transparent, define auxiliary steps with transparent colors in your ValueRangePalette:
In data filling, replace your NaNs with aux step extreme value, to make a sharp cut without interpolated colors.
And by setting
, it won't cross-render the semi-transparent triangles in the cut zone.
Then the chart appears as:
Is this OK?
To make certain parts of IntensityGridSeries transparent, define auxiliary steps with transparent colors in your ValueRangePalette:
Code: Select all
private ValueRangePalette CreatePalette(Arction.LightningChartUltimate.SeriesXY.SeriesBaseXY ownerSeries, double ymin, double YRange)
{
ValueRangePalette palette = new ValueRangePalette(ownerSeries);
palette.Type = PaletteType.Gradient;
double yRange = YRange - ymin;
palette.Steps.Clear();
palette.MinValue = ymin;
palette.Steps.Add(new PaletteStep(palette, Color.Blue, ymin));
palette.Steps.Add(new PaletteStep(palette, Color.Lime, ymin + 33 * yRange / 100.0));
palette.Steps.Add(new PaletteStep(palette, Color.Yellow, ymin + 66 * yRange / 100.0));
palette.Steps.Add(new PaletteStep(palette, Color.Red, ymin + 100.0 * yRange / 100.0));
palette.Steps.Add(new PaletteStep(palette, Color.FromArgb(0, 0, 0, 0), ymin -10)); //Aux step
palette.Steps.Add(new PaletteStep(palette, Color.FromArgb(0,0,0,0), -1E9)); //Aux step
return palette;
}
Code: Select all
for (int iCol = 0; iCol < iSizeX; iCol++)
{
float intensity = (Z[iCol * nY + iRow]);
if(float.IsNaN(intensity))
intensity = -1E9f;
data[iCol, (nY - 1) - iRow].Value = intensity;
}
Code: Select all
m_intensityGrid.FullInterpolation = false;
Then the chart appears as:
Is this OK?
LightningChart Support Team, PT
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: NaN data in IntensityGridSeries
If user wanta node to be rendered as transparent, there are following options nowadays:
1) replace extreme value with NaN. If PixelRendering = false, then highest palette’s step color is used. If PixelRendering = true, then lowest palette’s step color is used. If you want color to be transparent, then added step with transparent color above/below main steps accordingly (as in above example).
2) Set each node’s color directly (including ‘problem’ value data[i, j].Color = Colors.Transparent) and use intensityGrid.Fill = IntensityFillStyle.FromSurfacePoints.
3) Use StencilAreas or in particular SubstractiveAreas+AdditiveAreas to clip data from particular area (User Manual chapter 6.34).
4) Use Series.ClipAreas property/feature, if want to hide row or columns of heatmap (User Manual chapter 6.30).
1) replace extreme value with NaN. If PixelRendering = false, then highest palette’s step color is used. If PixelRendering = true, then lowest palette’s step color is used. If you want color to be transparent, then added step with transparent color above/below main steps accordingly (as in above example).
2) Set each node’s color directly (including ‘problem’ value data[i, j].Color = Colors.Transparent) and use intensityGrid.Fill = IntensityFillStyle.FromSurfacePoints.
3) Use StencilAreas or in particular SubstractiveAreas+AdditiveAreas to clip data from particular area (User Manual chapter 6.34).
4) Use Series.ClipAreas property/feature, if want to hide row or columns of heatmap (User Manual chapter 6.30).