Zooming doesn't working as expected

7 posts, 0 answers
  1. Vadim
    Vadim avatar
    8 posts
    Member since:
    Feb 2009

    Posted 14 Mar 2012 Link to this post


    Hello,

    According to this post I have noticed one feature. When I set Zoom = new Size(2,1) AxisX really increased 4 times (not 2 !!!). ChartView display 4 times more DataPoints and AxisX values. Maybe it was misunderstanding?

    Best Regards,
    Vadim
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 19 Mar 2012 Link to this post

    Hi,

    I was not able to reproduce such a behavior in my tests. In the project that is attached in the other thread - If I click on the last row of the grid view - a zoom of 2/1 (new Size(2, 1))  is applied and it does display half of the total data, which is correct.

    If you keep experiencing problems with this you can create a small project that we can run, that reproduces the issue in mind (the project should include the data you are testing with) so we can investigate whether there is a problem and where it originates. 

    Kind regards,
    Petar Marchev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Vadim
    Vadim avatar
    8 posts
    Member since:
    Feb 2009

    Posted 19 Mar 2012 Link to this post

    Hello, Petar

    In attachment you project with different data. Unfortunately I can't add zip file to the thread. If the interval is 2 or 3 hours Zoom and PanOffset doesn't working as expected. (4 or 5 interval). Please use this code in project for ticket 519602: 

    private Random generator = new Random(1243);
     
    public MainViewModel()
    {
        DateTime now = new DateTime(2012, 3, 9);
        Infos = new List<TemperatureInfo>();
     
        for (int i = 0; i < 600; i++)
        {
            Infos.Add(new TemperatureInfo() { Date = now.AddHours(i), Value = generator.NextDouble()});
        }
     
        this.Intervals = new List<Interval>()
        {
            new Interval { StartDate = now.AddDays(-20), EndDate = now.AddDays(4), },
            new Interval { StartDate = now.AddDays(-18), EndDate = now.AddDays(0),},
            new Interval { StartDate = now.AddDays(-5), EndDate = now.AddDays(-1),},
            new Interval { StartDate = now.AddDays(0).AddHours(1), EndDate = now.AddDays(0).AddHours(3),},
            new Interval { StartDate = now.AddDays(-10).AddHours(10), EndDate = now.AddDays(-10).AddHours(13),},
            new Interval { StartDate = now.AddDays(-9), EndDate = now.AddDays(-8),},
            new Interval { StartDate = now.AddDays(-15), EndDate = now.AddDays(-12),},
            new Interval { StartDate = now.AddDays(3), EndDate = now.AddDays(4),},
            new Interval { StartDate = now.AddDays(1), EndDate = now.AddDays(3),},
        };
    }


    Best regards,
    Vadim
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 22 Mar 2012 Link to this post

    Hello Vadim,

    As you asked me to - I did copy paste your code. I altered the Intervals collection, so that all intervals fall in the range of the underlying data.

    Now when I select the first row - the zoom that is set is Size(2, 1). (the actual value is not 2, but is a number that is very close to 2, I updated the project so now in the up left corner you can see a text box which shows what zoom was applied).

    When I select the first row - a zoom of 2/1 is applied and I can see that the data that is shown is actually half of the total data. So, once again I was not able to reproduce the issue that you describe.

    If the Intervals do not fall in the range of the underlying data - issues will appear. This is because it was not taken into account that such a case may appear. I updated the ZoomChart_PanOffsetZoom method to check whether the selectedStart and selectedEnd are inside the range of the Infos dates. Now when I select the last row (which has a start date prior to any date in the Infos collection) - a zoom of 3/1 is applied and a third of the total information is shown. (the selected start date is not respected, because the underlying items do not hold information for these dates).

    I have attached the project so you can see the changes that I have made to it.

    May be I was not able to answer to your question, so if you keep experiencing problems you can try to explain what exactly is the issue and again include some code to help us reproduce it.

    Kind regards,
    Petar Marchev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Andreas
    Andreas avatar
    8 posts
    Member since:
    Mar 2011

    Posted 02 Apr 2012 Link to this post

    Hello Petar,

    Thank you for prepared example, it works fine for me in most cases.  
    I'm not sure, but you could restrict max zoom for ChartView. When zoom is setting in a large number the ChartView behaves unexpectedly. Your example with large zoom in attachment looks like a bug.
  7. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 05 Apr 2012 Link to this post

    Hi Andreas,

    In the previously attached project I have created an implicit style that targets the PanZoomBar and set a MinimumRangeSpan:
    <Style TargetType="telerik:PanZoomBar">
      <Setter Property="MinimumRangeSpan" Value=".05" />

    I have done this on purpose because currently there is a known framework limitation related to the canvas' size. Our developers have started investigating the problematic behavior and are considering to create a virtualized mechanism so that this will not be an issue in the future. For now you can avoid this by setting an appropriate minimum range span.

    All the best,
    Petar Marchev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  8. Andreas
    Andreas avatar
    8 posts
    Member since:
    Mar 2011

    Posted 05 Apr 2012 Link to this post

    Hi Petar,

    Good, please, let me know when the issue will be solved.

    Best Regards,
    Andreas
Back to Top
DevCraft banner