Profile Picture

How to zoomIn or ZoomOut Chart programatically?

Posted By Niranjan Singh 12 Years Ago
Author
Message
Niranjan Singh
Posted 12 Years Ago
View Quick Profile
Forum Member

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
Last Active: 4 Years Ago
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
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

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
Posted 12 Years Ago
View Quick Profile
Forum Member

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
Last Active: 4 Years Ago
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.



Similar Topics


Reading This Topic