How to zoomIn or ZoomOut Chart programatically?


Author
Message
Niranjan Singh
Niranjan Singh
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 49, Visits: 179
NChartCommander commander = new NChartCommander();
commander.ChartControl = nChartControl1;
commander.ZoomStep = 1;
commander.RotationStep = 1;
commander.ChartSizeStep = 1;


NZoomInCommand cmd = commander.Commands.GetCommandFromId((int)ChartCommand.ZoomIn) as NZoomInCommand;

How to Execute this Command. It is Enabled property is false always.
How NChartCommander and NChartCommand or NZoomInCommand interact to reflect the effect on the chart control.

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Niranjan,

In general the commands on the toolbar simply configure the chart - there is no need to create them or to execute them in order to achieve a particular configuration. For example in order to enable mouse zooming you need to execute:

nChartControl1.Controller.Tools.RemoveAllChildren();
nChartControl1.Controller.Tools.AddChild(
new NSelectorTool());
nChartControl1.Controller.Tools.AddChild(
new NOffsetTool());


similarly zoom is achived using:

nChartControl1.Controller.Tools.RemoveAllChildren();
nChartControl1.Controller.Tools.AddChild(
new NSelectorTool());
nChartControl1.Controller.Tools.AddChild(
new NZoomTool());

We would recommend to check out the examples located at All Examples\Interactivity\Tools regarding the usage of different chart tools.



Best Regards,
Nevron Support Team


Niranjan Singh
Niranjan Singh
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 49, Visits: 179
Hi,
Thanks for your answer, but i am not using NChartCommandBarsManager class(UI component). I have my buttons and checed button on which i just need zoom in, zoom out, trackball and paning functionality.

Your documentation is not good to understand that how these classes interact with each other. In the first paragraph of written as:

"Commands are used to facilitate the implementation of any chart user action, which can be performed from a menu, toolbar or context menu."

Then How can we implement this using these commands, i have discovered much your classes about this but process of interaction of chart and these command is not clear.


Is these command directly implemented on chart or must add the toolbar with chart control.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search