Example #1
0
        private void InsertSurfaceChart(SpreadSurfaceChart chart, string name, double x, double y, double width, double height)
        {
            chart.Name = name;
            chart.Location = new Point(x, y);
            chart.Size = new Size(width, height);

            List<Color> colors = new List<Color>
            {
                Colors.White,
                Colors.White
            };
            chart.ColorPalette = colors;
            chart.ContourLevelsCount = 1;
            chart.Fill = new SolidColorBrush(Color.FromArgb(255, 47, 219, 223));
            chart.Legend = null;
            TestActiveSheet.SurfaceCharts.Add(chart);
        }
Example #2
0
        private SpreadSurfaceChart CreateSurfaceChart(double xmin, double ymin, double xmax, double ymax, zfunc zfunc)
        {
            SpreadSurfaceChart chart = new SpreadSurfaceChart();
            int n = 21;
            var zdata = new double[n, n];
            var dx = (xmax - xmin) / (n - 1);
            var dy = (ymax - ymin) / (n - 1);

            for (int i = 0; i < n; i++)
            {
                SpreadDataSeries ds = new SpreadDataSeries();
                ds.Values = new DoubleSeriesCollection();
                for (int j = 0; j < n; j++)
                {
                    double value = zfunc(xmin + i * dx, ymin + j * dy);
                    ds.Values.Add(value);
                }
                chart.DataSeries.Add(ds);
            }
            return chart;
        }