i am not able to upload an image on infragisitcs website from my system . so, i am posted my question here.
http://stackoverflow.com/questions/20992041/infragistic-zoombar-size-change-default-value
Regards,
Kamlendra
Hello Kamlendra,
Thank for your post. I have been looking into it and I can sat that you can add images by pressing the Options tab while you are composing your post and there you can upload an image. As for the question about the xamzoombar, as Damyan suggested in the Stackoverflow thread, you can see this Data Chart Integration (identical Silverlight live version) samples.
As described in the documentation the Zoombar's thumb location and size are determined by the range, so looking at your image I think you want range like { 0.9 - 1 }: <ig:XamZoombar>
<ig:XamZoombar.Range>
<ig:Range Minimum="0.9" Maximum="1"/>
</ig:XamZoombar.Range>
</ig:XamZoombar>
Adjust the minimum value to match what you want to achieve and check out the documentation/sample for snippets to set it in code. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Hi Stefan,
the solution provided by you helps me to achieve what i want. but i am loosing synchronization with my chart.
My Chart:
<ig:XamDataChart x:Name="xmDataChart" DataContext="{Binding Path=SelectedDevice.RFMonitorData}" Margin="30,20,30,0" Background="Transparent" PlotAreaBackground="Transparent" HorizontalZoomable="True" HorizontalZoombarVisibility="Collapsed" VerticalZoomable="False" VerticalZoombarVisibility="Collapsed" OverviewPlusDetailPaneVisibility="Collapsed" > <ig:SyncManager.SyncSettings> <ig:SyncSettings SyncChannel="charts" SynchronizeHorizontally="True" SynchronizeVertically="False" /> </ig:SyncManager.SyncSettings>
...
My ZoomBar:
<ig:XamZoombar Name="xamZoombar1" VerticalAlignment="Top" Background="Transparent" Opacity=".8" Range="{Binding ElementName=xmDataChart, Path=HorizontalZoombar.Range, Mode=TwoWay}" >
please let me know how can i sync with my chart and at the same time have the range between 0.9 to 1.
i made required modification to your sample(implemented OnXamZoombarZoomChanged,OnXamDataChartWindowRectChanged,OnXamChart_PreviewMouseWheel). and that way i am able to achieve the Synonization and required thumb min/max. the only issue is onload the XAMdDataChartWindowRectangle is not updated. once user click on XamzoomBar : the handler OnXamZoombarZoomChanged is getting called and things are getting corrected.1.Behaviour class 2. ( i have both expected and current image ready with me but your website doesn't provide upload from PC it ask for url:give me a mild ID where i can send these images.)
Important observation: initially this.Chart object is getting null so this.Chart.WindowRectChanged event never getting registered.
1. please find the Behaviour class:
using Infragistics;using Infragistics.Controls;using Infragistics.Controls.Charts;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Data;using System.Windows.Input;using System.Windows.Interactivity;
namespace AKG4.Forms.Behaviors{ public class ZoomBarRangeBehaviour :Behavior<XamDataChart> {
private XamDataChart Chart { get { return AssociatedObject as XamDataChart; } }
public XamZoombar HorizontalZoombar { get { return (XamZoombar)GetValue(HorizontalZoombarProperty); } set { SetValue(HorizontalZoombarProperty, value); } }
// Using a DependencyProperty as the backing store for HorizontalZoombar. This enables animation, styling, binding, etc... public static readonly DependencyProperty HorizontalZoombarProperty = DependencyProperty.Register("HorizontalZoombar", typeof(XamZoombar), typeof(ZoomBarRangeBehaviour), new PropertyMetadata(SetZoombar));
private static void SetZoombar(DependencyObject obj, DependencyPropertyChangedEventArgs e) { Binding binding = new Binding { Source = (obj as ZoomBarRangeBehaviour).Chart, Path = new PropertyPath("HorizontalZoombar.Range"), Mode = BindingMode.TwoWay }; (obj as ZoomBarRangeBehaviour).HorizontalZoombar.SetBinding(XamZoombar.RangeProperty, binding); (obj as ZoomBarRangeBehaviour).HorizontalZoombar.Range = new Range { Minimum = 0.9, Maximum = 1 };
// detach the old events so we don't leak memory (obj as ZoomBarRangeBehaviour).DetachEvents();
// attach the new events (obj as ZoomBarRangeBehaviour).AttachEvents();
}
private void AttachEvents() { this.HorizontalZoombar.ZoomChanged += OnXamZoombarZoomChanged; //this.HorizontalZoombar.ZoomChanging+=HorizontalZoombar_ZoomChanging; if (this.Chart != null) this.Chart.WindowRectChanged += OnXamDataChartWindowRectChanged; } private void DetachEvents() { this.HorizontalZoombar.ZoomChanged -= OnXamZoombarZoomChanged; //this.HorizontalZoombar.ZoomChanging -= HorizontalZoombar_ZoomChanging; if(this.Chart!=null) this.Chart.WindowRectChanged -= OnXamDataChartWindowRectChanged; }
bool fromMouseWheel = false; double scaleH = -1; double scaleV = -1; double positionH = -1; double positionV = -1; public bool IsZoombarChanging; private void OnXamZoombarZoomChanged(object sender, ZoomChangedEventArgs e) { if (this.Chart == null) return; if (IsZoombarChanging) return; try { IsZoombarChanging = true; Range zoombarRange = e.NewRange; HorizontalZoombar.Range = zoombarRange; this.Chart.WindowRect = new Rect { Y = 0, Height = 1, X = zoombarRange.Minimum, Width = (zoombarRange.Maximum - zoombarRange.Minimum) }; } finally { IsZoombarChanging = false; } } private void OnXamChart_PreviewMouseWheel(object sender, MouseWheelEventArgs e) { fromMouseWheel = true; scaleH = this.Chart.WindowScaleHorizontal; scaleV = this.Chart.WindowScaleVertical; positionH = this.Chart.WindowPositionHorizontal; positionV = this.Chart.WindowPositionVertical; }
private void OnXamDataChartWindowRectChanged(object sender, RectChangedEventArgs e) { if (IsZoombarChanging) return; if (fromMouseWheel) return; try { IsZoombarChanging = true; Range newZoombarRange = new Range { Minimum = e.NewRect.X, Maximum = e.NewRect.X + e.NewRect.Width }; if (this.HorizontalZoombar != null) { this.HorizontalZoombar.Range = newZoombarRange; } } finally { IsZoombarChanging = false; fromMouseWheel = false; } }
protected override void OnAttached() { base.OnAttached(); }
I used your code in order to modify the sample i sent you before, and the OnXamZoombarZoomChanged event doesn't fire on start up, but once i clicked it and the event fires, nothing changes, so I am still not able to fully understand your requirement. Could you please try to modify the sample, so it reproduces your issue and add a screenshot of the desired result in the archive, so I could be able to investiagte this further?
i have uploaded images https://ko.infragistics.com/my-account/support-case/CAS-129688-V0X3B1 (the cases allow us to upload images w/o url).i feel the only culprit in this problem is : initially this.Chart object is getting null so this.Chart.WindowRectChanged event never getting registered.
i am using 2 chart objects. 1) <ig:XamDataChart x:Name="xmDataChart" DataContext=... (for lower part, big chart in image)2) (The Other one is child of zoombar in HorizontalPreviewContent) which is synchronized with the main (Name:"xmDataChart") <ig:XamZoombar Name="xamZoombar1" VerticalAlignment="Top" Background="Transparent" Margin="5,5,50,5"
Range="{Binding ElementName=xmDataChart, Path=HorizontalZoombar.Range, Mode=TwoWay}" Opacity=".8"> <ig:XamZoombar.HorizontalPreviewContent> <ig:XamDataChart DataContext="{Binding
Is this causing the this.Chart object in the behaviour class as null and not registring the event this.Chart.WindowRectChanged .hope by seeing the images it will be clear.
hi Stefan,
hope you got a chance to take a look at the images. https://ko.infragistics.com/my-account/support-case/CAS-129688-V0X3B1how can i make this.Chart object as not null using two different XamDataChart as explained earlier. (i feel this will fix it) and allow us to register this.Chart.WindowRectChanged , which is not happning now.
Regards,Kamlendra
Hi Kamlendra,
After looking into this forum thread discussion and the images provided in the case I am not completely sure what is causing this issue on your side. From the pictures it seems that not all data points are displayed in the chart located in the zoombar. Is that the issue on your side? I have been looking into the sample project Stefan had provided and it is running as expected – the chart is zoomed according to the range of the zoombar’s thumb. Would you please let me know if Stefan’s application is the behavior you are trying to achieve? Could you please upload a sample project so I can test it on my side and investigate it further for you? This will help me understand your scenario and offer you a better solution. Thank you.
Hello Maria,
i will try to summarize and explain again:
"From the pictures it seems that not all data points are displayed in the chart located in the zoombar. Is that the issue on your side? ":: ----- the issue is other way. in my zoomBar i am able to see all data. but it should only specific zoomed data.you can find out from the name of my images:Current: Currentoutput-onloadWithoutclickonZoombar-showingallValuesfromStart.pngExpected: ExpectedOutput-afterClickonZoomBar-showingOnlyZoomedValues.png
**the issue only persist until user click the zoombar. because "this.Chart.WindowRectChanged " is not getting registered. so, in my view the only issue is WindowRectChanged event registration.
(Explaining Again)i feel the only culprit in this problem is : initially this.Chart object is getting null so this.Chart.WindowRectChanged event never getting registered.
Range="{Binding ElementName=xmDataChart, Path=HorizontalZoombar.Range, Mode=TwoWay}"Opacity=".8"><ig:XamZoombar.HorizontalPreviewContent><ig:XamDataChart DataContext="{Binding
Is this causing the this.Chart object in the behaviour class as null and not registring the event this.Chart.WindowRectChanged .