in

Software FX Community

Discuss and find help for all Software FX products.

Equivalent of AxisX.PixPerUnit, other than SetScrollView?

Last post 06-09-2009 4:02 PM by thubble. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-20-2009 12:07 PM

    Equivalent of AxisX.PixPerUnit, other than SetScrollView?

    In pre-WPF versions of ChartFX, there was the ability to hardcode the PixPerUnit value for the X axis so that when the chart is resized to be smaller, the number of points displayed will be constant until there are too many points to display at the current PixPerUnit value.

    In ChartFX for WPF, the PixPerUnit property seems to have been removed, so the only option is to use SetScrollView. The problem is that SetScrollView always sets the PixPerUnit based on the current size of the chart. So for example, if the chart is very large and there are only 2 points displayed, the points will be huge on the screen. This is fine, except that when the chart is made smaller, the points will remain huge and a scrollbar will appear with only one point displayed.

    Is there any way to preserve the old behaviour, i.e. that the points will get smaller until there are too many to display at the current PixPerUnit, and only then will the scrollbar appear? The only solution I've found is to call SetScrollView from the chart's SizeChanged event, and this is definitely not ideal.

    Thanks in advance.

  • 05-22-2009 7:10 PM In reply to

    • JuanC
    • Top 10 Contributor
    • Joined on 03-02-2007

    Re: Equivalent of AxisX.PixPerUnit, other than SetScrollView?

    We have added the PixelsPerUnit to the Axis class retaining the old (WinForms, ASP.NET) behavior.

    A hotfix will be available early next week with support for this.

    Regards,

    JuanC

    Filed under:
  • 06-01-2009 5:18 PM In reply to

    • JuanC
    • Top 10 Contributor
    • Joined on 03-02-2007

    Re: Equivalent of AxisX.PixPerUnit, other than SetScrollView?

    A hotfix is now available that includes support for this new property.

    You can download our most recent hotfix here.

    Regards,

    JuanC

  • 06-03-2009 7:40 PM In reply to

    Re: Equivalent of AxisX.PixPerUnit, other than SetScrollView?

    Using version 3439 - AxisX.PixelsPerUnit works when you first set it (either through XAML or through Code) but if you change the data (either by assigning a new binding source or changing the existing one) it crashes with the error: "'Infinity' is not a valid value for property 'LargeChange'."

    This seems to happen mostly when there is a scrollbar showing on the X axis, but sometimes even when there's not.

    I've tried putting "AxisX.SetScrollView(0,0)" before changing the data, it still doesn't work.

    Any ideas?

  • 06-04-2009 1:56 PM In reply to

    Re: Equivalent of AxisX.PixPerUnit, other than SetScrollView?

    It looks like the above bug also happens when you use SetScrollView(). If you have a chart that does not have a scroll bar with the current ScrollView, then you change the data so that it needs a scrollbar (by adding more points) and call .Refresh(), it crashes with the error: "'Infinity' is not a valid value for property 'LargeChange'."

  • 06-09-2009 4:02 PM In reply to

    Re: Equivalent of AxisX.PixPerUnit, other than SetScrollView?

    This seems to be fixed in build 3442 - thanks!

Page 1 of 1 (6 items)
Copyright 2008 Software FX, Inc.