Hello there,
i am using the datachart more and more, and thus it seems i run into more and more Detail questions.
At this time i was taking care of zooming and have 2 questions
1) Can i change the Color (brush) of the zooming rectangle (outline) while using the mouse? One of my Charts Needs to have a black Background and the zooming rectangle cannot be ssen.
2) When drawing the zooming rectangle, while the left mouse button is down, i have an issue, when i Approach the x or y axis. I want to Setup the zooming rectangle by starting in the middle of the Chart, move the mouse down to the x-axis (so that i get each Point) and then move the mouse to the left. But movin the mouse left is not possible when having the mouse Cursor on or a Little bit underneath the x-axis line. This way of zooming is very Handy in my case. Is there a way to realize this?
I hope ist clear what i mean.
Thank you,
Thomas
Hi Thomas,
Looking at the source the DragRect stroke used is set to black and there is no exposed way to change that... I'll submit an item for us to adjust the DragRect stroke.
We are also purposely not adjusting the DragRect when the mouse goes outside the PlotArea. I'm still looking at this area to see if we can toggle this capture. A workaround would be to go left as far as you need to and then mouse up into the plot area and then back down below the axis to get all those points in the zoom rect.
Hi Matthew,
thanks for the answer.
I would really appreciate being able to set the stroke of the zooming rectangle.
Regarding the second Point, i did something like this (example for the x-axis)
1) in the Chart mouse down Event i set a flag, isZooming, to true
2) in the Chart mouse up Event, i reset this flag to false
3) in the Chart mouse move Event, i currently do this:
if (isZooming) { if (!chartSpectrum.ViewportRect.Contains(e.Location)) { if (e.Location.Y > chartSpectrum.ViewportRect.Bottom) { System.Drawing.Point pCurrent = Cursor.Position; pCurrent = chartSpectrum.PointToClient(pCurrent); pCurrent.Y = (int)chartSpectrum.ViewportRect.Bottom - 1; Cursor.Position = chartSpectrum.PointToScreen(pCurrent); } } }
this now has to be done for all sides of the viewport rect
Thanks thomas
We can use Development Issue #223056 to track the progress for setting the outline of the DragZoom rectangle. I'm still looking into the second item to see how we can allow the rect to be drawn outside the plot area easier for those that wish to not keep it contained.
The latest SR includes the fix for 223056 in versions 15.2 and 16.1. Head on over to My Keys and Downloads Page on the Infragistics Website. To download the service release, select the 'Dev Tools' tab and then select the volume you are using. Finally, select the 'Service Releases' tab and the available service releases will be listed below.
Remember to re-test your application after the service release has been applied and the application has been updated, and inform us if you discover anything in that re-test.
In regards to the fix, a property was added, PreviewPathStroke, which allows the application to customize the color of the rectangle drawn during a drag zoom operation.
it took a while, but I just applied SR 2088.
Re-Testing the application showed no side effects at all.
And using the PreviewPathStroke Property works like it should.
This really helps me.
Thanks for implementing that.
Glad to hear it is working and the re-test looks good. Thanks for bringing the color of the zoom rect to our attention!
Thanks for adding the PreviewPathStroke property, it is exactly the feature I am looking for. I am currently on version 2015.2, I guessed this is not available until later versions. Which version did this property started to appear in? If upgrading is not possible immediately, are there any interim solutions that I can do in the meantime, like modifying a css or a js file? Thanks.
When the PreviewPathStroke property was added it was only added for Windows forms and is a product idea for Ignite UI and you can suggest this on the ideas site.
Thanks Alan. I just realized I am on the wrong forum, I needed this for the igniteui igDataChart. We don't see such property in the 2017.1, do you know if such is available in igniteui? Thanks.
The PreviewPathStroke property is present in the latest service release of 2015 Volume 2 and 2016 Volume 1. It can also be expected in the release of 2016 Volume 2.