I have a XamDataChart with three horizontal chartinfostrips that denote warning and action limits for the chart. I have a text box in which the users can alter the Start and End Y values for these strips.
The strips work well with the exception of one problem. I update the values of the strips but they dont actually visually refresh until I perform some sort of action on the chart such as zooming in or panning.
I am assuming this is because some refresh method needs to be called somewhere.
Thanks
Steve
Hello Steve,
Thank you for your post.
I am assuming that you are using the ChartInfoStripsBehavior as demonstrated here: http://es.infragistics.com/samples/wpf/data-chart/chart-info-strips. Please let me know if this is not the case, as the following goes off of that assumption.
Currently, the reason that the XamDataChart's info strips are not updating is because there isn't anything to tell them to update. There is a method that exists on the ChartInfoStripsBehavior called RefreshStrips. This is called whenever an InfoStrip is added or removed from the info strip collection attached to the XamDataChart, when the axis the strip is related to has its size change in some way, or when the XamDataChart's WindowRect property changes or when the XamDataChart's size changes. The actual start and end X and Y values of the InfoStrips are also currently just regular double properties, and are not currently hooking into any particular "property changed" type of event.
My recommendation to you is to modify this ChartInfoStripsBehavior as well as the actual InfoStrips class. I would recommend that you begin by creating an internal property on the InfoStrip class of type ChartInfoStripsBehavior, so that each InfoStrip in your XamDataChart has a reference back to its owning ChartInfoStripsBehavior. Then, in the OnStripsCollectionChanged handler of the ChartInfoStripsBehavior, you can catch the InfoStrips objects as they are added to the collection that will be shown in the XamDataChart. This will allow you to set this new behavior property to "this." This will allow you to access the public Refresh method from the InfoStrips class, which calls the RefreshStrips method.
The other modifications that would now need to be made are to remove the StartX, EndX, StartY, and EndY double properties in favor of a dependency property for each one. Doing this will allow you to hook into a property changed event for each of those properties that will fire when one of the corresponding values changes. Since you now have a reference to the ChartInfoStripsBehavior via the internal property mentioned above, you can cast the DependencyObject to an InfoStrip, and then call MyInfoStrip.OwningBehaviorInternalProperty.Refresh() to refresh the position of the InfoStrips when their Start or End X or Y properties change.
I have attached a sample project to demonstrate the above. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hi
I finally found some time to return to this issue!
This doesnt help much. Basically I have two Numeric UpDown controls which provide two value that represent areas +- a mean value.
When these are changed they update the Start and End Y properties on the info strips and they are refreshed correctly
However I also have a combobox which allows the user to select Scale modes, (basically the min and max values for the Y axis), I then rescale the Y axis by setting the Minimum and Maximum Y Axis values, then I call the same method that updates the Info Strips I use with the Numeric UpDowns.
In this second scenario nothing visually happens until the user zooms in slightly, I have tried manually calling the Refresh method, calling InvalidateVisual on anything I can access, but no joy. It works with the numeric up down but not with the combo box.
This is very strange
Steven
is there any News on this issue?
I think I am running into the same Problems. The strips do not update after an axis rescale due to some range changes in dynamic sereies.
Regards Horst
for those who will run into this Problem my solution is adding a axis.RangeChanged Event handler:
private void Axis_RangeChanged(object sender, AxisRangeChangedEventArgs e) { RefreshStrips(); }
------------------------------------------------------------------