FlexChart: AxisX.ActualMax or Min strange values question

Posted by: a.sharov on 4 November 2021, 2:34 pm EST

    • Post Options:
    • Link

    Posted 4 November 2021, 2:34 pm EST

    Hi.

    I have code wich generate data with current date and bind it to chart

     
                flexChart3.DataSource = _data;
                
                var xCoord = new Series
                {
                        Name = "X",
                        Binding = "X",
                        BindingX = "Date",
                        ChartType = ChartType.LineSymbols,
                };
                flexChart3.Series.Add(xCoord);
    
    

    Date component is hourly values for some period:

    
            public List<XPosition> GetXVals()
            {
                var list = new List<XPosition>();
                var now =  DateTime.UtcNow;
                var after = now.AddMonths(3); //now.AddYears(1);
                var x = 1000;
            
                //2886336.6267
                var rand = new Random();
                while(now < after)
                {
    
    
                    list.Add(new XPosition
                    {
                            Date = now,
                            X = (temp % 2 == 0 ? 1 : -1) * temp / 10000.0,
                           
                    });
                    now = now.AddHours(1);
                }
    
                return list;
            }
    
    

    For AxisX of the chart I see value for ActualMax like 44596.746771481485. I figured out that this values i s a number of days since 1900 (1/1/1900). Well, I simply generated data from 1/1/1900 and values was like 1,2,3,4,.

    Is it correct? Is there any documentation for that?

    Thanks in advance.

  • Posted 11 November 2021, 12:47 am EST

    Hi Anton,

    I hope you got the solution from here:

    https://www.grapecity.com/forums/winforms-edition/range-selector-and-aggreat

    JFYI, DateTime values can’t be plotted to a chart. So, C1FlexChart uses the OLE representation of date. You can refer to the same from MSDN docs:

    https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tooadate?view=netframework-4.5.2

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels