I woud like to scroll UltraChart horizontally by mouse wheel with Shift key pressed. How can I do that?
The functionality is built into the 3d charts, but if you're using a 2d chart you will have to implement this.
First, make sure the scrollbars are enabled:ultraChart1.Axis.X.ScrollScale.Visible = true;ultraChart1.Axis.Y.ScrollScale.Visible = true;
Then, handle the mouse wheel event on the control and set Scroll and Scale properties inside ultraChart1.Axis.X.ScrollScale and ultraChart1.Axis.Y.ScrollScale.
I tried to use this mouse wheel event handler:
private void MapChart_MouseWheel(object sender, MouseEventArgs e){ HandledMouseEventArgs he = e as HandledMouseEventArgs; if (he == null) return; if (ModifierKeys == Keys.Shift) { if (Axis.X.ScrollScale.Visible) { double newScroll = Axis.X.ScrollScale.Scroll; if (e.Delta > 0) { newScroll += 0.1; if (newScroll > 1) newScroll = 1; } else if (e.Delta < 0) { newScroll -= 0.1; if (newScroll < 0) newScroll = 0; } Axis.X.ScrollScale.Scroll = newScroll; } he.Handled = true; }}
but it doesn't work. What's wrong? By the way, the version is 9.2.20092.2035