Profile Picture

Possible bug with NChart.Refresh() after adding mesh surface ?

Posted By Richard Aidley 9 Years Ago

Possible bug with NChart.Refresh() after adding mesh surface ?

Author
Message
Richard Aidley
Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 3, Visits: 16
Hi, we're trying out the latest Nevron and having the following problem;
After changing our surface in a mesh surface view, the screen does not update unless we 'resize' the view. We have tried .Refresh() on the chart, but this does not make any difference.
We can replicate the problem by modifying the Nevron example code in the following way;

to NMeshSurfaceUC.xaml.cs add

<Button Content="New Mesh" Name="NewMeshButton" Click="NewMeshButton_Click" />

to NMeshSurfaceUC.xaml.cs
modify

private void FillData(NMeshSurfaceSeries surface, double firstmod = 4.0, double secondmod = 3.0)
        {
            double x, y, z;
            int nCountX = surface.Data.GridSizeX;
            int nCountZ = surface.Data.GridSizeZ;

            for (int j = 0; j < nCountZ; j++)
            {
                for (int i = 0; i < nCountX; i++)
                {
                    x = 2 + i + Math.Sin(j / firstmod) * 2;
                    z = 1 + j + Math.Cos(i / firstmod);

                    y = Math.Sin(i / secondmod) * Math.Sin(j / secondmod);

                    if (y < 0)
                    {
                        y = Math.Abs(y / 2.0);
                    }

                    surface.Data.SetValue(i, j, y, x, z);
                }
            }
        }

And Add

  private void NewMeshButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            NChart chart = nChartControl1.Charts[0];

            NMeshSurfaceSeries surface = (NMeshSurfaceSeries)chart.Series.Add(SeriesType.MeshSurface);

            surface.Name = "Surface";
            surface.Legend.Mode = SeriesLegendMode.SeriesLogic;
            surface.FillMode = SurfaceFillMode.Zone;
            surface.PositionValue = 0.5;
            surface.Data.SetGridSize(20, 20);
            surface.SyncPaletteWithAxisScale = false;
            surface.PaletteSteps = 8;
            surface.ValueFormatter.FormatSpecifier = "0.00";
            surface.FillStyle = new NColorFillStyle(Color.YellowGreen);

            var firstmod = _rand.NextDouble() * 6.0 + 1.0;
            var secondmod = _rand.NextDouble() * 6.0 + 1.0;
            FillData(surface,firstmod,secondmod);

            chart.Refresh();
        }

        private Random _rand = new Random();

Are we doing something wrong, or is there a genuine problem ?
Thanks



Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Richard,

The only problem with this code is that you need to call:

nChartControl1.Refresh();

otherwise you're refreshing the chart image map only. Let us know if you meet any problems or have any questions.




Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic