public void AddChart(ChartStyle2D cs, DataSeriesSurface ds)
        {
            switch (ChartType)
            {
            case ChartTypeEnum.XYColor:
                cs.AddChartStyle2D(this);
                if (cs.IsColorBar && IsColormap)
                {
                    cs.AddColorBar2D(cs, ds, this, ds.ZDataMin(), ds.ZDataMax());
                }
                AddXYColor(cs, ds);
                break;

            case ChartTypeEnum.Contour:
                cs.AddChartStyle2D(this);
                if (cs.IsColorBar && IsColormap)
                {
                    cs.AddColorBar2D(cs, ds, this, ds.ZDataMin(), ds.ZDataMax());
                }
                AddContour(cs, ds);
                break;

            case ChartTypeEnum.FillContour:
                cs.AddChartStyle2D(this);
                if (cs.IsColorBar && IsColormap)
                {
                    cs.AddColorBar2D(cs, ds, this, ds.ZDataMin(), ds.ZDataMax());
                }
                AddXYColor(cs, ds);
                AddContour(cs, ds);
                break;

            case ChartTypeEnum.MeshContour3D:
                cs.AddChartStyle();
                AddContour3D(cs, ds);
                AddMesh(cs, ds);
                break;

            case ChartTypeEnum.SurfaceContour3D:
                cs.AddChartStyle();
                AddContour3D(cs, ds);
                AddSurface(cs, ds);
                break;

            case ChartTypeEnum.SurfaceFillContour3D:
                cs.AddChartStyle();
                AddXYColor3D(cs, ds);
                AddContour3D(cs, ds);
                AddSurface(cs, ds);
                break;
            }
        }
 private void AddChart()
 {
     chartCanvas.Children.Clear();
     cs                 = new ChartStyle2D();
     cs.ChartCanvas     = this.chartCanvas;
     cs.GridlinePattern = ChartStyle.GridlinePatternEnum.Solid;
     cs.Elevation       = 30;
     cs.Azimuth         = -37;
     cs.Title           = "No Title";
     cs.IsColorBar      = true;
     ds                 = new DataSeriesSurface();
     ds.LineColor       = Brushes.Transparent;
     Utility.Peak3D(cs, ds);
     d3c           = new Draw3DChart();
     d3c.ChartType = Draw3DChart.ChartTypeEnum.XYColor;
     cs.AddChartStyle2D(d3c);
     d3c.IsInterp     = true;
     d3c.NumberInterp = 5;
     d3c.AddChart(cs, ds);
 }