This is a migrated thread and some comments may be shown as answers.
Problems with Integrating PanZoom, TrackBall and LassoZoom Controllers in RadChartView
8 Answers 24 Views
This is a migrated thread and some comments may be shown as answers.
Artur
Top achievements
Rank 1
Artur asked on 12 Apr 2018, 08:56 AM

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?

8 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 13 Apr 2018, 07:37 AM
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.
0
Artur
Top achievements
Rank 1
answered on 16 Apr 2018, 06:42 AM

Hello Hristo,

That solved the problev, thank you for helping

0
asghar
Top achievements
Rank 1
answered on 05 Feb 2019, 11:39 AM

hi

 

0
Hristo
Telerik team
answered on 05 Feb 2019, 01:11 PM
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.
0
asghar
Top achievements
Rank 1
answered on 05 Feb 2019, 03:24 PM

hi.

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

0
asghar
Top achievements
Rank 1
answered on 05 Feb 2019, 03:32 PM

hi

my version is 2015.2

0
asghar
Top achievements
Rank 1
answered on 06 Feb 2019, 06:11 AM
There is no solution?
0
Hristo
Telerik team
answered on 06 Feb 2019, 09:43 AM
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.
Asked by
Artur
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Artur
Top achievements
Rank 1
asghar
Top achievements
Rank 1
Share this question
or