LineSeries points not connected properly.

3 posts, 0 answers
  1. Sacha
    Sacha avatar
    5 posts
    Member since:
    Mar 2019

    Posted 20 May Link to this post

    Hello,

     When using the following code my data points don't get connected properly, as seen in picture attached.
    The picture attached is from only one Series object.The data is a list of objects with properties amount (an int) and datetime which is a value like this xxh30 or xxh00. 
        DateTimeCategoricalAxis categoricalAxis = new DateTimeCategoricalAxis();
        categoricalAxis.PlotMode = Telerik.Charting.AxisPlotMode.BetweenTicks;
        categoricalAxis.DateTimeComponent = Telerik.Charting.DateTimeComponent.Hour;
     
        categoricalAxis.LabelFormat = "{0:HH:mm}";
     
        foreach (RadCheckedListDataItem item in radCheckedDropDownListDates.CheckedItems)
        {
            List<MonitoringToolDomain.FILESPROCESSED> queryChart = new List<MonitoringToolDomain.FILESPROCESSED>();
            queryChart = MonitoringToolCore.FilesProcessed.QueryLineChart((DateTime?)item.DataBoundItem, fromHour, toHour);
     
            queryChart.Select(c => { c.DATETIME = CreateDateFromTime(2015, 12, 12, c.DATETIME); return c; }).ToList();
     
            LineSeries test = new LineSeries
            {
                DataSource = queryChart,
                ValueMember = "AMOUNT",
                CategoryMember = "DATETIME",
                IsVisibleInLegend = true,
                LegendTitle = item.DataBoundItem.ToString()
                //CombineMode = Telerik.Charting.ChartSeriesCombineMode.None
            };
            test.HorizontalAxis = categoricalAxis;
            radChartView.Series.Add(test);
     
        }
        radChartView.ShowLegend = true;
    }

     I have a second problem, not sure if I should post it here but I don't want to create too many new threads. I would like to compare charts from different days as in my second attached picture. If I create different line series, the charts appear sequentially because they don't have the same date. The solution I'm using at the moment is to change the DATETIME parameter in all of my objects to have the same date part. Is there any other way to do this ? 

    What I'm doing now : 
    queryChart.Select(c => { c.DATETIME = CreateDateFromTime(2015, 12, 12, c.DATETIME); return c; }).ToList();

  2. Sacha
    Sacha avatar
    5 posts
    Member since:
    Mar 2019

    Posted 20 May Link to this post

    Something that I should add and might be the reason of the problem now that I think about it is that I add sometimes several objects with the same property DATETIME. 

    It would look like this.

                    new ChartTest("test", 70, "12/04"),
                    new ChartTest("test", 70, "15/04"),
                    new ChartTest("test", 70, "16/04"),
                    new ChartTest("test", 70, "16/04"),
                    new ChartTest("test", 70, "16/04"),
                    new ChartTest("test", 70, "16/04")

    It works great with barcharts but could this be the cause of the strange connections ? Should I fusion my objects like this ?

                    new ChartTest("test", 280, "16/04")

    Or is there another way ?

  3. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3406 posts

    Posted 21 May Link to this post

    Hello, Sacha,     

    According to the provided information, it seems that you have many identical categories, e.g. "16/04". This means that all values belonging to this category will be rendered in the same category tick. It is not very clear why the group is actually a date part only and the DateTimeCategoricalAxis uses hours format together with the DateTimeComponent.Hour. I suppose that it would be better to use different hours as categories or provide DateTime values instead of text values in the DataSource that is applied to the LineSeries. Thus, the points will be placed more precisely according to the hour component. 

    If you are still experiencing any undesired behavior, feel free to submit a support ticket from your Telerik account and provide a sample project demonstrating the undesired behavior. Thus, our support staff will be able to make an adequate analysis of the precise case and provide further assistance.
     
    Note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread. Thank you for your understanding.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top