Profile Picture

Several Controller.Tools combined

Posted By Ricardo Sousa 15 Years Ago
Author
Message
bob milanov
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi Ricardo,

The NDataCursorTool will update the cursors of the actively selected chart - this is done intentionally in the case you have multiple charts in the control. When you click on the title and have a selector tool in the tools collection the selection will change and therefore the cursors will not be updated (as the selection will now contain the title). You can modify this behavior by using static selection:

NChart chart = nChartControl1.Charts[0];
nChartControl1.Controller.Selection.Clear();
nChartControl1.Controller.Selection.Add(chart);

// now add tools without NSelectorTool
nChartControl1.Controller.Tools.Add(new NDataCursorTool());
nChartControl1.Controller.Tools.Add(
new NAxisScrollTool());
nChartControl1.Controller.Tools.Add(
new NDataZoomTool());
nChartControl1.Controller.Tools.Add(
new NDataPanTool());

Now the chart will always have the first chart selected no matter where you click.

As for the ActiveTool it is used when you use dragging - when a tool enters dragging mode it will intercept the mouse/keyboard input and it will not be routed to the rest of the tools. I don't think it applies in this case...

Hope I helped - let me know if you meet any problems or have any questions.

Best regards,
Bob

 



Ricardo Sousa
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 1, Visits: 1

Hi all, I'm using all this tools and it works just fine.

 

nChartControl1.Controller.Tools.Add(new NDataCursorTool());

nChartControl1.Controller.Tools.Add(new NSelectorTool());

nChartControl1.Controller.Tools.Add(new NAxisScrollTool());

nChartControl1.Controller.Tools.Add(new NDataZoomTool());

nChartControl1.Controller.Tools.Add(new NDataPanTool());

 

The only problem is when I click outside off the chart area, like title for instance, the AxisCursor disappear and only gets back when I clicked the series area.

I already get the mouse event and notice that the "nChartControl1.Controller.ActiveTool"

is null.

Can anyone advise?





Similar Topics


Reading This Topic