SeriesPointCompactColored3D single point color changed

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
grey
Posts: 6
Joined: Mon May 22, 2023 9:03 am

SeriesPointCompactColored3D single point color changed

Post by grey » Wed May 24, 2023 10:19 am

in View3D PointLineSeries3D,I want change the color of one SeriesPointCompactColored3D in PointLineSeries3D.PointsCompactColored when i click it,I add test code in the demo,but the color not changed unless I resize the window after i click,is it a bug? the code is blow

Code: Select all

            //Add 3D point series
            //Spheres 
            PointLineSeries3D sphereSeries = new PointLineSeries3D(_chart.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary);
            sphereSeries.PointStyle.Shape3D = PointShape3D.Sphere;
            sphereSeries.PointStyle.Size3D.SetValues(20, 20, 20);
            //sphereSeries.Material.DiffuseColor = Colors.Teal;
            //sphereSeries.Material.SpecularColor = Colors.Gray;
            //sphereSeries.Material.SpecularPower = 20;
            //sphereSeries.PointStyle.DetailLevel = 100;
            sphereSeries.IndividualPointColors = true;
            sphereSeries.AllowUserInteraction = true;
            sphereSeries.PointsType = PointsType3D.CompactPointsColor;
            sphereSeries.LineVisible = false;
            int defaultColor = -2987746;
            sphereSeries.PointsCompactColored = new SeriesPointCompactColored3D[] {
                new SeriesPointCompactColored3D(50, 50, 50,defaultColor),
                new SeriesPointCompactColored3D(30, 50, 20,defaultColor),
                new SeriesPointCompactColored3D(80, 50, 80, defaultColor)
            };
            sphereSeries.MouseClick += SphereSeries_MouseClick;
            _chart.View3D.PointLineSeries3D.Add(sphereSeries);

Code: Select all

        private void SphereSeries_MouseClick(object sender, System.Windows.Input.MouseEventArgs e)
        {
            if (sender is PointLineSeries3D compactSeries)
            {
                int selectColor = -65536;
                int hitIndex = compactSeries.LastHitTestIndex;
                compactSeries.PointsCompactColored[hitIndex].Color = selectColor;
            }
        }
int the image,the red ball is changed color after i click it and resize the window
Attachments
微信截图_20230524181729.png
微信截图_20230524181729.png (676.88 KiB) Viewed 7563 times

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: SeriesPointCompactColored3D single point color changed

Post by ArctionKestutis » Wed May 24, 2023 12:32 pm

Chart is automatically update if you change Property of the chart. If you change just individual item in array or just field in the structure, then you should inform chart about need to refresh data. Call Series.InvalidateData() after you modified color.

grey
Posts: 6
Joined: Mon May 22, 2023 9:03 am

Re: SeriesPointCompactColored3D single point color changed

Post by grey » Thu May 25, 2023 2:10 am

ArctionKestutis wrote: Wed May 24, 2023 12:32 pm Chart is automatically update if you change Property of the chart. If you change just individual item in array or just field in the structure, then you should inform chart about need to refresh data. Call Series.InvalidateData() after you modified color.
Thanks

Post Reply