This is a migrated thread and some comments may be shown as answers.

LineSeries points not connected properly.

2 Answers 104 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Sacha
Top achievements
Rank 1
Sacha asked on 20 May 2019, 03:02 PM
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 Answers, 1 is accepted

Sort by
0
Sacha
Top achievements
Rank 1
answered on 20 May 2019, 04:24 PM

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 ?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 May 2019, 07:58 AM
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.
Tags
ChartView
Asked by
Sacha
Top achievements
Rank 1
Answers by
Sacha
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or