Code: Select all
public partial class Form1 : Form
{
private LightningChartUltimate _mChart3D = null;
private SurfaceMeshSeries3D _mSurfaceMeshSeries3D = null;
public Form1()
{
InitializeComponent();
CreateChart();
}
private void CreateChart()
{
_mChart3D = new LightningChartUltimate();
_mChart3D.BeginUpdate();
_mChart3D.Parent = panel1;
_mChart3D.Dock = DockStyle.Fill;
_mChart3D.ActiveView = ActiveView.View3D;
_mChart3D.View3D.Camera.RotationY = 60;
_mChart3D.View3D.Camera.ViewDistance = 200;
_mChart3D.View3D.ClipContents = true;
_mChart3D.View3D.WallOnBack.Visible = false;
_mChart3D.View3D.WallOnLeft.Visible = false;
_mChart3D.View3D.WallOnRight.Visible = false;
_mChart3D.View3D.WallOnTop.Visible = false;
_mChart3D.View3D.WallOnFront.Visible = false;
_mChart3D.View3D.WallOnBottom.Visible = true;
_mSurfaceMeshSeries3D = new SurfaceMeshSeries3D(_mChart3D.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary)
{
ContourLineType = ContourLineType3D.None,
ContourLineWidth = 0,
TraceMouseCell = false,
MouseInteraction = false,
MouseHighlight = MouseOverHighlight.None,
ColorSaturation = 100,
SuppressLighting = true,
Fill = SurfaceFillStyle.PalettedByY,
WireframeType = SurfaceWireframeType.None
};
_mChart3D.View3D.SurfaceGridSeries3D.Clear();
_mChart3D.View3D.SurfaceMeshSeries3D.Add(_mSurfaceMeshSeries3D);
var iColumnCount = 150; // Working if value is <= 143
var iRowCount = 33323;
var minXIndex = 0;
var maxXIndex = iColumnCount;
var minYIndex = -205;
var maxYIndex = 2000;
var minZIndex = 0;
var maxZIndex = iRowCount;
_mSurfaceMeshSeries3D.Data = null;
_mSurfaceMeshSeries3D.SizeX = iColumnCount;
_mSurfaceMeshSeries3D.SizeZ = iRowCount;
float yValue = 10;
var flag = true;
for (int iCol = 0; iCol < iColumnCount; iCol++)
{
for (int iRow = 0; iRow < iRowCount; iRow++)
{
if (_mSurfaceMeshSeries3D.Data != null)
{
if (yValue > 2000) flag = true;
else if (yValue < -205) flag = false;
if (flag) yValue = (float) (yValue - 0.01);
else yValue = (float)(yValue + 0.01);
_mSurfaceMeshSeries3D.Data[iCol, iRow].Y = yValue;
_mSurfaceMeshSeries3D.Data[iCol, iRow].X = iCol;
_mSurfaceMeshSeries3D.Data[iCol, iRow].Z = iRow;
}
}
}
_mChart3D.View3D.XAxisPrimary3D.SetRange(minXIndex, maxXIndex);
_mChart3D.View3D.YAxisPrimary3D.SetRange(minYIndex, maxYIndex);
_mChart3D.View3D.ZAxisPrimary3D.SetRange(minZIndex, maxZIndex);
var palette = new ValueRangePalette(_mSurfaceMeshSeries3D);
palette.Steps.Clear();
palette.MinValue = 0;
palette.Type = PaletteType.Gradient;
palette.Steps.Add(new PaletteStep(palette, Color.Blue, 10));
palette.Steps.Add(new PaletteStep(palette, Color.Green, 500));
palette.Steps.Add(new PaletteStep(palette, Color.Yellow, 1000));
palette.Steps.Add(new PaletteStep(palette, Color.Red, 1500));
//and set to mesh
_mSurfaceMeshSeries3D.ContourPalette = palette;
_mChart3D.EndUpdate();
}
}
When I set iColumnCount (defined in sample code) variable to <= 143 then it will displayed 3d chart but If I set iColumnCount variable to > 143 then blank chart displayed with new version(7.1.1)
I need to set iColumnCount more then 200.What changes can be done with current code for fixed this issue?
Thanks