Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2614 - Setting Line Series Smoothing from True to False loses data when DataMembers are set
Summary: Setting Line Series Smoothing from True to False loses data when DataMembers ...
Status: RESOLVED FIXED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-31 08:29 EDT by christopher ireland
Modified: 2023-05-31 08:42 EDT (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description christopher ireland 2023-05-31 08:29:49 EDT
Code to reproduce:

        public Form1()
        {
            InitializeComponent();
            _line1 = new Line(tChart1.Chart);
            InitializeChart(_line1);
        }

        Line _line1;

        private void button1_Click(object sender, EventArgs e)
        {
            _line1.Smoothed = !_line1.Smoothed;
        }

        class Student
        {
            public string Name { get; set; }
            public double Value { get; set; }
            public DateTime BirthDate { get; set; }

            public Student(string name, double value, DateTime birth)
            {
                Name = name;
                Value = value;
                BirthDate = birth;
            }
        }

        private void InitializeChart(Line age)
        {
            age.XValues.DateTime = true;
            age.XValues.DataMember = "BirthDate";
            age.YValues.DataMember = "Value";
            age.LabelMember = "Name";
            age.Title = "Children";

            void UseClass()
            {
                List<Student> list = new()
                {
                    new Student("A", 10, DateTime.Parse("1987-06-21")),
                    new Student("B", 5, DateTime.Parse("1992-12-03")),
                    new Student("C", 11, DateTime.Parse("1965-08-15")),
                    new Student("D", 14, DateTime.Parse("1979-02-09"))
                };

                age.Add(list as IList);
            }

            UseClass();
        }
    }

Clicking twice on the button causes data to be lost.