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

Bar chart bars are very thin for some datasets!

5 Answers 74 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 14 Sep 2017, 02:58 PM

Hi,

Sometimes the bars are extremely thin for some sparse datasets.  When I display a bar chart with a DateTimeContinuousAxis horizontal axis, spanning just a few hours with only 2 or 3 items, the bars are extremely thin.  If I change the timespan to a day, also with just a few items, the bars look normal (see attached screenshots).  I'm using UI for WPF Q2 2016, Is this s bug?

Thanks,

Brian

5 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 19 Sep 2017, 10:47 AM
Brian,

Thank you for inquiring about our RadChartView control.

Using only the provided information I am not sure what exactly is the reason behind this. In your post, you mentioned that you change the timespan to a day and also few other items. Can you elaborate more on which ones? Have you changed the PlotMode property of the DateTimeContinuousAxis? Have you specified custom Style/DataTemplate to the BarSeries?

It will be great if you can send me an isolated project from your application reproducing this type of behavior. This way I can directly investigate it on my side.

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Brian
Top achievements
Rank 1
answered on 19 Sep 2017, 01:21 PM

Hi Dinko,

You can download a simple project showing the issue from the link below (can't attach a zip file to this message).

https://qisoft1-my.sharepoint.com/personal/brian_qisoft_com/_layouts/15/guestaccess.aspx?docid=1fa10317323aa4516924a5840a251669d&authkey=AUESDzcGFhILHOzb6M7j5sA&expiration=2017-10-18T23%3a00%3a00.000Z

The sample shows the chart and a toggle button to switch between thin and thick bars - all the button does is change the minimum and maximum dates for the date axis from a 1.5 hour range to a 13 hour range, so I assume this is the cause of the issue, but I don't see why the bars should get thinner when the date range gets smaller.  Any help much appreciated.

Thanks,

Brian

0
Martin
Telerik team
answered on 22 Sep 2017, 07:04 AM
Hello Brian,

Thank you for the provided sample. We are researching the case but we need a little more time for this. We will get back to you as soon as possible. Hopefully, this will be on Monday.

Regards,
Martin Vatev
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 25 Sep 2017, 03:24 PM
Brian,

Thanks for your patience.

This is expected behavior. Let me try to explain. Basically, DateTimeContinuous axis calculates the bars' length based on the date time range and the major step, which can be calculated automatically or specified manually. By default, if the major step is not specified, the axis will try to come up with a step and unit that will allow your axis to show a reasonable amount of ticks (and labels). If the range and the step are such that there are many units between the start and end dates, the bars' length will be smaller. On the other hand, if there are not many units, the bar's length will be larger.

So in your case when the range of the axis is 1.5 hour the chart internally calculate the MajorStepUnit (Minute) and the MajorStep ( 1 ) which will lead to small length for the data items (bars) - the length of each bar will be 1 minute mapped to pixels.

If you know that the granularity for your data is an hour, you can adjust the length of the bars by specifying MajorStep and MajorStepUnit depending on the incoming data.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Brian
Top achievements
Rank 1
answered on 26 Sep 2017, 12:56 PM

Hi Dinko,

Thanks for the explanation, I'll play with these values and see if I can get a reasonable compromise for our data.

Brian

Tags
ChartView
Asked by
Brian
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Brian
Top achievements
Rank 1
Martin
Telerik team
Share this question
or