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

RangeBarSeries, Proportional size in function of the area instead of the steps ?

1 Answer 127 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Mickael
Top achievements
Rank 1
Mickael asked on 20 Sep 2018, 11:11 AM

Hi,

I'm working with a RadCartesianChart to display Value / Time.
I'm using an DateTimeContinuousAxis as bottom axis. 
On this Axis I use a Major Step Unit in Days.

I display 2 series. One with value in days and one with value in hour.

The day serie is display with a simple LineSeries.

The hour serie MUST but be displayed in a RangeBarSeries to show min/max values.

In this case the Bar are to wide. My probleme is that RangeBarSerieModel generate a RadSize in function of the Axis Step size and not in function of the value covered by it.
In this case the Bar are to wide. 

For example 1 step == 1 day is represented by 28px then the bar have a width of 28px.

Is it possible to change the behavior to have a bar width = (Day/hour) * StepSize = Min(1,  1/24 * 28) ?

This way the width of the bar correspond to the time the value represent.

Thanks,

 

 


1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 25 Sep 2018, 07:30 AM
Hi Mickael,

What you could try is to specify custom DataTemplate for the PointTemplate property of the RangeBarSeries. Then you can declare a Rectangle and bind the Width property. The DataContext of the DataTemplate is a RangeDataPoint object. The next step is to create custom IValueConverter class and apply it to the binding. In the Convert() method you can return the desired value. I am not sure about your formula but you can use the approach and create your own formula on your side.

For your convenience, I have created a sample project to demonstrate this approach. The project is attached to this reply. Give this project a try and let me know if it works for you. 

Regards,
Dinko
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
Chart
Asked by
Mickael
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or