Create Heat Map from data array?

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

Felix
Posts: 72
Joined: Tue Oct 29, 2013 8:10 am

Create Heat Map from data array?

Post by Felix » Tue Oct 29, 2013 8:26 am

Hello,

I created a Grid Series 3D Surface chart from files and would like to create a heat map.
In the demo software, the heat map is created from a bitmap, but not from a data array.

How should I proceed?

Code Grid Series 3D Surface:

Code: Select all

private void Create3DChart(SurfacePoint[,] data)
{
	lcuChart.BeginUpdate();
	
	lcuChart.View3D.Camera.RotationX = 45;
	lcuChart.View3D.LegendBox.Visible = IsColorbarDisplayed;

	if (!IsScalingAuto)
	{
		lcuChart.View3D.XAxisPrimary3D.Minimum = ScaleXMin;
		lcuChart.View3D.XAxisPrimary3D.Maximum = ScaleXMax;
		lcuChart.View3D.YAxisPrimary3D.Minimum = ScaleYMin;
		lcuChart.View3D.YAxisPrimary3D.Maximum = ScaleYMax;
		lcuChart.View3D.ZAxisPrimary3D.Minimum = ScaleZMin;
		lcuChart.View3D.ZAxisPrimary3D.Maximum = ScaleZMax;
	}

	_surface = new SurfaceGridSeries3D(lcuChart.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary);
	_surface.ContourLineType = ContourLineType.None;
	_surface.WireframeType = _isGridDisplayed ? SurfaceWireframeType.Wireframe : SurfaceWireframeType.None;
	_surface.SmoothShading = true;
	_surface.ColorSaturation = 80;
	_surface.ContourPalette = CreateColorPalette(_surface, 100);
	_surface.Data = data;

	_surface.MouseDoubleClick += surface_MouseDoubleClick;
	_surface.MouseTraceCellChanged += surface_MouseTraceCellChanged;

	lcuChart.View3D.SurfaceGridSeries3D.Add(_surface);

	_surface.InvalidateData();

	lcuChart.EndUpdate();
}

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Create Heat Map from data array?

Post by ArctionPasi » Wed Oct 30, 2013 12:06 pm

Hi Felix,

This is a simple example of 3 x 2 size surface grid.

Code: Select all

//Set Y values
            SurfacePoint[,] data = new SurfacePoint[3, 2];
            data[0, 0].Y = 20;
            data[1, 0].Y = 40;
            data[2, 0].Y = 15; 
            data[0, 1].Y = 25;
            data[1, 1].Y = 5;
            data[2, 1].Y = 45;
            _surface.Data = data; 

            //Set X and Z ranges 
            _surface.SetRangesXZ(0, 100, 0, 50); 
LightningChart Support Team, PT

Felix
Posts: 72
Joined: Tue Oct 29, 2013 8:10 am

Re: Create Heat Map from data array?

Post by Felix » Tue Nov 05, 2013 1:58 pm

Thanks for the help.