hi,
I want to change the extent of the axis by using the mouse dragging as you do in dragging data point.
You can try the following code:
public class MovingAxisTool : InteractionTool
{
private Point prevPoint;
/// <summary>
/// Initializes a new instance of the <see cref="MovingAxisTool"/> class.
/// </summary>
/// <param name="ultraChart">The ultra chart.</param>
}
/// Determines whether this tool can start.
/// <returns>
/// <c>true</c> if this tool can start; otherwise, <c>false</c>.
/// </returns>
IAdvanceAxis axisY = chartLayer.Grid["Y"] as IAdvanceAxis;
double yValue = (double)axisY.MapInverse(this.prevPoint.Y);
/// Called when this tool is started and the mouse is moved.
int newExtend = this.UltraChart.Axis.X.Extent - dy;
newExtend = 0;
newExtend = 500;
this.prevPoint = this.LastInput.ViewPoint;
/// Called when this tool stops.
...
this.ultraChart1.DataSource = DemoTable.Table();
MovingAxisTool movingAxisTool = new MovingAxisTool(this.ultraChart1);
What do I need to do to modify this code to work with a composite chart that has multiple layers?
For starters, the CanStart function uses GetLayer, how do we return the correct layer?
Thanks,
Talal Nehme
http://forums.infragistics.com/forums/p/13054/48869.aspx#48869
Here I made some changes in the code.
In this case you can try:
private AxisItem axisItem;
IAdvanceAxis axis = chartLayer.Grid["X"] as IAdvanceAxis;
int dy = this.LastInput.ViewPoint.Y - prevPoint.Y;