Hi,
sorry to be almost "spamming" but we need some answers pretty soon ... Is there a way to zoom using the mouse and when in zoom (so not scale 1) implement the right-click in a manner that panning becomes possible ?
If so, could you give some tips (or working code :-) ) to get this done ?
Thanks,
Wim
Hi
I need to change the color of the box while mouse is drawing on the chart.
Dim xAxis As IAdvanceAxis = DirectCast(e.Grid("X"), IAdvanceAxis)
Dim yAxis As IAdvanceAxis = DirectCast(e.Grid("Y"), IAdvanceAxis)
Dim width As Integer = Math.Abs(m_endPoint.X - m_startPoint.X)
Dim height As Integer = Math.Abs(m_endPoint.Y - m_startPoint.Y)
Dim box As New Primitives.Box(m_startPoint, width, height)
Thanks
This is version 8.2 feature.
Where can I find InteractionTool ??
I can't get the Chartsamples to work, it crashes giving following error :
Zie het einde van dit bericht voor meer informatie over het aanroepen van JIT-foutopsporing (Just In Time) in plaats van dit dialoogvenster.************** Tekst van uitzondering **************System.TypeInitializationException: De type-initialisatiefunctie voor ChartSamplesExplorerCS.Config heeft een uitzondering veroorzaakt. ---> System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld. bij ChartSamplesExplorerCS.Config.get_ConnectionString() bij ChartSamplesExplorerCS.Config..cctor() --- Einde van intern uitzonderingsstackpad --- bij ChartSamplesExplorerCS.Config.get_NavigationXml() bij ChartSamplesExplorerCS.SamplesExplorerMain.LoadSamplesNavigationTree() bij ChartSamplesExplorerCS.SamplesExplorerMain.Form1_Load(Object sender, EventArgs e) bij System.EventHandler.Invoke(Object sender, EventArgs e) bij System.Windows.Forms.Form.OnLoad(EventArgs e) bij System.Windows.Forms.Form.OnCreateControl() bij System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) bij System.Windows.Forms.Control.CreateControl() bij System.Windows.Forms.Control.WmShowWindow(Message& m) bij System.Windows.Forms.Control.WndProc(Message& m) bij System.Windows.Forms.ScrollableControl.WndProc(Message& m) bij System.Windows.Forms.ContainerControl.WndProc(Message& m) bij System.Windows.Forms.Form.WmShowWindow(Message& m) bij System.Windows.Forms.Form.WndProc(Message& m) bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)************** Geladen assembly's **************mscorlib Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------ChartSamplesExplorerCS Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Temp/ChartSamplesExplorerCS.exe----------------------------------------System.Windows.Forms Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------Infragistics2.Win.UltraWinExplorerBar.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.UltraWinExplorerBar.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.UltraWinExplorerBar.v8.1.dll----------------------------------------Infragistics2.Win.UltraWinDock.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.UltraWinDock.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.UltraWinDock.v8.1.dll----------------------------------------Infragistics2.Win.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.v8.1.dll----------------------------------------Infragistics2.Win.UltraWinToolbars.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.UltraWinToolbars.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.UltraWinToolbars.v8.1.dll----------------------------------------Infragistics2.Shared.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Shared.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Shared.v8.1.dll----------------------------------------Infragistics2.Win.Misc.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.Misc.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.Misc.v8.1.dll----------------------------------------Infragistics2.Win.UltraWinTabbedMdi.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.UltraWinTabbedMdi.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.UltraWinTabbedMdi.v8.1.dll----------------------------------------System.Design Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll----------------------------------------System.Xml Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------Infragistics2.Win.UltraWinTree.v8.1 Assembly-versie: 8.1.20081.1000 Win32-versie: 8.1.20081.1000 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Infragistics2.Win.UltraWinTree.v8.1/8.1.20081.1000__7dd5c3163f2cd0cb/Infragistics2.Win.UltraWinTree.v8.1.dll----------------------------------------System.Data Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll----------------------------------------System.Configuration Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------mscorlib.resources Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------System.Windows.Forms.resources Assembly-versie: 2.0.0.0 Win32-versie: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_nl_b77a5c561934e089/System.Windows.Forms.resources.dll----------------------------------------************** JIT-foutopsporing **************Als u JIT-foutopsporing wilt inschakelen, moet in het configuratiebestand voor dezetoepassing of computer (machine.config) de waardejitDebugging in het gedeelte system.windows.forms zijn ingesteld.De toepassing moet ook zijn gecompileerd terwijl foutopsporingwas ingeschakeld.Bijvoorbeeld:<configuration> <system.windows.forms jitDebugging="true" /></configuration>Wanneer JIT-foutopsporing is ingeschakeld, worden onverwerkte uitzonderingennaar het JIT-foutopsporingsprogramma gestuurd dat op de computer is geregistreerden worden niet door dit dialoogvenster verwerkt.
You can try using:
public class PanningTool : InteractionTool
{
private AxisAppearance axisApp;
/// <summary>
/// Initializes a new instance of the <see cref="PanningTool"/> 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>
/// Called when this tool starts.
this.axis = gridLayer.Grid["X"] as Axis;
this.prevPoint = this.LastInput.ViewPoint;
/// Called when this tool is started and the mouse is moved.
int dx = this.LastInput.ViewPoint.X - prevPoint.X;
double coef = (axis.MapRange + correction) * (1 - axis.Scale);
if (double.IsNaN(scrollOffset))
double d = axisApp.ScrollScale.Scroll + scrollOffset;
d = 0;
d = 1;
axisApp.ScrollScale.Scroll = d;
/// Called when this tool stops.
...
PanningTool panningTool = new PanningTool(this.ultraChart1);
this.ultraChart1.AddMouseDownTool(panningTool);
You can also try looking at the WinForms ChartSamples - Chart Interaction.