Problems with Integrating PanZoom, TrackBall and LassoZoom Controllers in RadChartView

9 posts, 1 answers
  1. Artur
    Artur avatar
    2 posts
    Member since:
    Apr 2018

    Posted 12 Apr 2018 Link to this post

    Hello,

    After implementing solution in style of article (http://www.telerik.com/support/kb/winforms/details/integrating-panzoom-trackball-and-lassozoom-controllers-in-radchartview), I have faced with some problems:

    1. After using LassoZoom I cannot move in plot area in the vertical direction

    2. Changing MyLassoZoomView class (for example changing color of selection rectangle) does not show any effect

    Could you help with this problem?

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 13 Apr 2018 Link to this post

    Hello Artur,

    Thank you for writing.

    The observed approach is a limitation of the public API exposed by the chart control. The desired behavior, however, can be achieved. Regarding the custom zoom view and the selection rectangle back color, you will need to use reflection and get the field of the base view and set it with reflection. Vertical panning seems to be disabled because of ShowPanZoom property which is set to true in the virtual OnMouseUp method in the custom lasso zoom controller. In the MyLassoZoomController class please change the constructor and the OnMouseUp methods this way: 
    public class MyLassoZoomController : LassoZoomController
    {
        private ViewResult result;
        private Keys modifierKey;
     
        public MyLassoZoomController()
            : this(Keys.Control) { }
     
        public MyLassoZoomController(Keys key)
        {
            FieldInfo fi = typeof(BaseLassoController).GetField("result", BindingFlags.Instance | BindingFlags.NonPublic);
            this.result = new ViewResult(new MyLassoZoomView(this));
            fi.SetValue(this, this.result);
            this.modifierKey = key;
        }
     
        public Keys ModifierKey
        {
            get
            {
                return this.modifierKey;
            }
            set
            {
                if (value == (Keys.Control | Keys.Shift | Keys.Alt))
                {
                    this.modifierKey = value;
                }
                else
                {
                    throw new ArgumentException("Passed key needs to be Control, Shift or Alt");
                }
            }
        }
     
        protected override ActionResult OnMouseUp(MouseEventArgs e)
        {
            if (Control.ModifierKeys == this.modifierKey)
            {
                this.View.ShowTrackBall = true;
                this.View.ShowPanZoom = true;
                ChartPanZoomController panZoomController = this.View.Controllers.Where(c => c is ChartPanZoomController).FirstOrDefault() as ChartPanZoomController;
                if (panZoomController != null)
                {
                    panZoomController.PanZoomMode = ChartPanZoomMode.Both;
                }
            }
     
            return base.OnMouseUp(e);
        }
     
        //...
    }

    I hope this helps. Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Artur
    Artur avatar
    2 posts
    Member since:
    Apr 2018

    Posted 16 Apr 2018 Link to this post

    Hello Hristo,

    That solved the problev, thank you for helping

  4. asghar
    asghar avatar
    23 posts
    Member since:
    Dec 2018

    Posted 05 Feb in reply to Hristo Link to this post

    hi

     

  5. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 05 Feb Link to this post

    Hi,

    Please make sure that you have added a reference to the Telerik.WinControls.ChartView.dll assembly.

    Let me know if you have other questions.

    Regards,
    Hristo
    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.
  6. asghar
    asghar avatar
    23 posts
    Member since:
    Dec 2018

    Posted 05 Feb in reply to Hristo Link to this post

    hi.

    i have added.but i can not add to may using.

  7. asghar
    asghar avatar
    23 posts
    Member since:
    Dec 2018

    Posted 05 Feb in reply to Hristo Link to this post

    hi

    my version is 2015.2

  8. asghar
    asghar avatar
    23 posts
    Member since:
    Dec 2018

    Posted 06 Feb in reply to Hristo Link to this post

    There is no solution?
  9. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 06 Feb Link to this post

    Hello,

    The custom project is also working well on my end using the 2015.2.728 version of the controls. Please check how the attached project will run on your side.

    Regards,
    Hristo
    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.
Back to Top