Hi,
I am trying to zoom user selected portion of chart.
user can draw rectangle or square by dragging mouse mouse.
startPosition : Mouse Down
End Position : Mouse Up or MouseMove
i draw rectangle from startPosition to End Position in FillSceneGraph event.
basically on MouseMove event i store EndPosition as current mouse location and call InvalidateLayers function on chart.
In FillSceneGraph event i draw rectangle from startPosition to EndPosition and add it to SceneGraph.
Every thing works fine except the delay in displaying rectangle.
is there any way to avoid the delay..or is FillSceneGraph is right place to add primitives on mousemove event.
as mousemove event is called for every few milliseconds ..
Thanks,
Kk
I am confused by what kalvagadda said.
According the information, it seems that the "Zoom By Area" (use left mouse to draw a rectangle to zoom in) feature is available already.
However, as far as I know, the feature has not been implemented. what we only have is using Alt + mouse scroll button in order to zoom in/out 3D charts. In order to zoom in/out 2D charts you should enable axis' scroll.
Please paste some code for example if you know how to zoom by area.
Anybody who knows something related can clarify this.
thanks
"click and drag" zooming is not a feature of our winchart. The only way to implement this feature is to use a combination of MouseDown, MouseUp and FillSceneGraph events. The mouse events will help you determine the size of the rectangular zooming region. FillSceneGraph can be used to calculate the scaling factor for the chart axes. I'm not sure if someone has successfully implemented this in the past.
Hi kalvagadda ,
Would you share the code with me through this forum? I appreciate it a lot. I know its been a year, hopefully you still have it.
Bobby
sorry to say , i don' t have that code with me.
Max,
Is there a sample code that you can share with us over here? I appreciate it.
Thanks kalvagadda.
Regards,
Bobby Pohan
Unfortunately, no. I haven't seen anyone successfully implement this, sorry.You can submit a feature request here, though:http://devcenter.infragistics.com/Protected/RequestFeature.aspx
Hi Max, I did that and I also have purchased infragistics license with standard support. Do I need to submit this request on a different link since I have the standard support? Thanks.
You can use OuterBound property of the chart layer to get the bounds rectangle instead of GridLayerBounds:Rectangle bounds = ultraChart1.CompositeChart.ChartLayers[0].ChartLayer.OuterBound;Also, when using a composite chart, remember to get the right Grid to avoid the axes being null:ChartLayer layer = ultraChart1.CompositeChart.ChartLayers[0].ChartLayer;IAdvanceAxis xAxis = (IAdvanceAxis)layer.Grid[0];IAdvanceAxis yAxis = (IAdvanceAxis)layer.Grid[1];
Hi, I tried to use it in an CompositeChart, but the calculation of scaleX and scaleY goes always wrong because the GridLayerBounds.Width and the GridLayerBounds.Height are always zero. I added a snippet:
try 1:
scaleX = xAxis.Scale * box.rect.Width / e.ChartCore.GridLayerBounds.Width; scaleY = yAxis.Scale * box.rect.Height / e.ChartCore.GridLayerBounds.Height;
try2:
offsetX = (this.ultraChart.CompositeChart.ChartLayers[0].ChartLayer.ChartCore.GridLayerBounds.Width / xAxis.Scale - this.ultraChart.CompositeChart.ChartLayers[0].ChartLayer.ChartCore.GridLayerBounds.Width) * xAxis.Scroll; offsetY = (this.ultraChart.CompositeChart.ChartLayers[0].ChartLayer.ChartCore.GridLayerBounds.Height / yAxis.Scale - this.ultraChart.CompositeChart.ChartLayers[0].ChartLayer.ChartCore.GridLayerBounds.Height) * yAxis.Scroll;
Does anybody know how it will work?
oh,thts great ...thnx fr ur immediate reply.
You cannot prevent zooming into a region with no data points. There's no way to tell if there are shapes drawn inside a particular rectangle, but you can do something to prevent zooming in when you just have a mouse click.
For this you can change the conditions of when the selection rectangle is valid. For example, you can force the rectangle to be at least 5x5 pixels:if the box's width and height are less than 5 set valid to false, and you shouldn't see the click problem.
Thnx fr the reply.If we drag the region where data is there,it is working great,and tht is the ultimate.
Suppose if I select an empty region,there also it is zooming..and tht time we will see empty chart only.
Is there any way to prevent the user to select that empty region.
And one more thing,if I click on any data column..then also it is getting zoomed.But i dont want to zoom tht in click.Because Iam doing drill down in tht click,and it is getting effected.
Is there any way to prevent zooming in the click of data column.
Iam very curios like how it will work....:):)