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

4 posts, 0 answers
  1. Chuck
    Chuck avatar
    2 posts
    Member since:
    Sep 2011

    Posted 08 Sep 2011 Link to this post

    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
  2. Missing user
    Missing user avatar

    Posted 13 Sep 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Chuck
    Chuck avatar
    2 posts
    Member since:
    Sep 2011

    Posted 15 Sep 2011 Link to this post

    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
  5. Missing user
    Missing user avatar

    Posted 20 Sep 2011 Link to this post

    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 >>

Back to Top