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

Data in RadColumnSparkline with RadTimebar is not display in the correct position

3 Answers 117 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Chuck
Top achievements
Rank 1
Chuck asked on 08 Sep 2011, 02:20 PM
Hello,

I have problem with RadColumnSparkline with RadTimebar.
It seems like the bars don't placed in the correct location.

I've looked in the thread "Data is not display in correct time location" and there's an example there for RadLinearSparkline with RadTimebar, I tried that example and the result was correct, but when I had changed the control from RadLinearSparkline to RadColumnSparkline, I saw some shifting in the bars.

Do I need to do some extra modifications for using RadColumnSparkline?

(I tried with Telerik RadControls for WPF 2011 Q2 2011.2.0712 & 2011.2.0823)


Thanks

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 13 Sep 2011, 01:38 PM
Hello Chuck,

The end point of the RadColumnSparkline should be one less than the TimeBar.PeriodEnd value and the RadLinearSparkline's end point should be equal to the TimeBar.PeriodEnd value.

I hope this information helps.

Regards,
Polina
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Chuck
Top achievements
Rank 1
answered on 15 Sep 2011, 06:43 AM
In your example (http://www.telerik.com/community/forums/wpf/timebar/data-is-not-displayed-in-correct-time-location.aspx#1683158)
, the x-axis is presented by DateTime struct, so I tried to make the end point of the RadColumnSparkline to be one hour less than the TimeBar.PeriodEnd, but still the view isn't correct.

Any other way to decrease the value of the end point by one value of DateTime?

new ContentData {TimeStamp = this.timeBar1.PeriodStart, Value = 0},
new ContentData {TimeStamp = new DateTime(2011, 4, 21, 09, 0, 0), Value = 0},
new ContentData {TimeStamp = new DateTime(2011, 4, 21, 10, 0, 0), Value = 3},
new ContentData {TimeStamp = new DateTime(2011, 4, 21, 11, 0, 0), Value = 0},
new ContentData {TimeStamp = new DateTime(2011, 4, 21, 19, 0, 0), Value = 0},
new ContentData {TimeStamp = new DateTime(2011, 4, 21, 20, 0, 0), Value = 10},
new ContentData {TimeStamp = new DateTime(2011, 4, 21, 21, 0, 0), Value = 0},
new ContentData {TimeStamp = new DateTime(2011, 4, 22, 12, 0, 0), Value = 0},
new ContentData {TimeStamp = new DateTime(2011, 4, 22, 13, 0, 0), Value = 3},
new ContentData {TimeStamp = new DateTime(2011, 4, 22, 14, 0, 0), Value = 2},
new ContentData {TimeStamp = new DateTime(2011, 4, 22, 15, 0, 0), Value = 0},
new ContentData {TimeStamp = this.timeBar1.PeriodEnd.AddHours(-1), Value = 0}


Thanks
0
Missing User
answered on 20 Sep 2011, 03:31 PM
Hello Chuck,

The example from the forum post, that you use as a reference, is prepared for the specific scenario in order to display peeks via the RadLinearSparkline control. Please note that the Sparkline will be stretched according to the width of the TimeBar content panel. Thus, as I already mentioned, you need to synchronize the RadTimeBar and the RadSparkline by yourself, so that the Sparkline XValues will match the period range of the TimeBar and the values will be displayed at the desired position. For example, if the period range of the TimeBar is 10 hours, you need to set Sparkline XValue for each hour. In the attached file you can find sample project that demonstrates the described approach.

I hope this helps.

Kind regards,
Polina
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TimeBar
Asked by
Chuck
Top achievements
Rank 1
Answers by
Missing User
Chuck
Top achievements
Rank 1
Share this question
or