zoom in zoom out from a point mschart
up vote
2
down vote
favorite
How to zoom from a point
for example zoom from point 300 to 500 axisX and 50 to 100 AxisY step by step
Current location
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Zooming X And Y
private void btnZoomXY_Click(object sender, EventArgs e)
step = (int)(chart1.ChartAreas["ChartArea1"].AxisX.Maximum - lastPoint.X ) / 20;
if (zoomx > chart1.ChartAreas["ChartArea1"].AxisX.Maximum)
zoomx -= step;
else
zoomx += step;
this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.Zoom(lastPoint.X+ zoomx, this.chart1.ChartAreas["ChartArea1"].AxisX.Maximum - zoomx);
if (Mode == SpectometrMode.Absorbance)
step1 = 0.2f;
else
step1 = (int)(chart1.ChartAreas["ChartArea1"].AxisY.Maximum - lastPoint.Y) / 20;
if (zoomY > chart1.ChartAreas["ChartArea1"].AxisY.Maximum)
zoomY -= step1;
else
zoomY += step1;
this.chart1.ChartAreas["ChartArea1"].AxisY.ScaleView.Zoom(lastPoint.Y+ zoomY, this.chart1.ChartAreas["ChartArea1"].AxisY.Maximum - zoomY);
chart1.ChartAreas[0].AxisX.LabelStyle.Format = "0";
@taW
c# mschart zooming
add a comment |
up vote
2
down vote
favorite
How to zoom from a point
for example zoom from point 300 to 500 axisX and 50 to 100 AxisY step by step
Current location
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Zooming X And Y
private void btnZoomXY_Click(object sender, EventArgs e)
step = (int)(chart1.ChartAreas["ChartArea1"].AxisX.Maximum - lastPoint.X ) / 20;
if (zoomx > chart1.ChartAreas["ChartArea1"].AxisX.Maximum)
zoomx -= step;
else
zoomx += step;
this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.Zoom(lastPoint.X+ zoomx, this.chart1.ChartAreas["ChartArea1"].AxisX.Maximum - zoomx);
if (Mode == SpectometrMode.Absorbance)
step1 = 0.2f;
else
step1 = (int)(chart1.ChartAreas["ChartArea1"].AxisY.Maximum - lastPoint.Y) / 20;
if (zoomY > chart1.ChartAreas["ChartArea1"].AxisY.Maximum)
zoomY -= step1;
else
zoomY += step1;
this.chart1.ChartAreas["ChartArea1"].AxisY.ScaleView.Zoom(lastPoint.Y+ zoomY, this.chart1.ChartAreas["ChartArea1"].AxisY.Maximum - zoomY);
chart1.ChartAreas[0].AxisX.LabelStyle.Format = "0";
@taW
c# mschart zooming
1
Hehe, this kind of Ping doesn't work. You need to a) know the current zoom center and your steps. Then the code should work. Always keep the center in the midle between zoom start and -end. If the center is at x=400 and the current zoom is at xstart= 100 you have a xdelta=300. For step=100 you can zoom to(origin-i*step, origin+i*step)
– TaW
Nov 11 at 8:29
@TaW my steps is different I have 3 mode in code . current zoom center showing by mouse click. please help me write this code .Thanks
– kamran amingalvani
Nov 11 at 8:44
1
I'll have a look later..
– TaW
Nov 11 at 13:00
I found the code a little confusing. My answer adresses the prime issue of wrong coordinates and shows a simple zooming scheme. Adapt as needed..!
– TaW
Nov 12 at 10:03
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
How to zoom from a point
for example zoom from point 300 to 500 axisX and 50 to 100 AxisY step by step
Current location
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Zooming X And Y
private void btnZoomXY_Click(object sender, EventArgs e)
step = (int)(chart1.ChartAreas["ChartArea1"].AxisX.Maximum - lastPoint.X ) / 20;
if (zoomx > chart1.ChartAreas["ChartArea1"].AxisX.Maximum)
zoomx -= step;
else
zoomx += step;
this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.Zoom(lastPoint.X+ zoomx, this.chart1.ChartAreas["ChartArea1"].AxisX.Maximum - zoomx);
if (Mode == SpectometrMode.Absorbance)
step1 = 0.2f;
else
step1 = (int)(chart1.ChartAreas["ChartArea1"].AxisY.Maximum - lastPoint.Y) / 20;
if (zoomY > chart1.ChartAreas["ChartArea1"].AxisY.Maximum)
zoomY -= step1;
else
zoomY += step1;
this.chart1.ChartAreas["ChartArea1"].AxisY.ScaleView.Zoom(lastPoint.Y+ zoomY, this.chart1.ChartAreas["ChartArea1"].AxisY.Maximum - zoomY);
chart1.ChartAreas[0].AxisX.LabelStyle.Format = "0";
@taW
c# mschart zooming
How to zoom from a point
for example zoom from point 300 to 500 axisX and 50 to 100 AxisY step by step
Current location
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Zooming X And Y
private void btnZoomXY_Click(object sender, EventArgs e)
step = (int)(chart1.ChartAreas["ChartArea1"].AxisX.Maximum - lastPoint.X ) / 20;
if (zoomx > chart1.ChartAreas["ChartArea1"].AxisX.Maximum)
zoomx -= step;
else
zoomx += step;
this.chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.Zoom(lastPoint.X+ zoomx, this.chart1.ChartAreas["ChartArea1"].AxisX.Maximum - zoomx);
if (Mode == SpectometrMode.Absorbance)
step1 = 0.2f;
else
step1 = (int)(chart1.ChartAreas["ChartArea1"].AxisY.Maximum - lastPoint.Y) / 20;
if (zoomY > chart1.ChartAreas["ChartArea1"].AxisY.Maximum)
zoomY -= step1;
else
zoomY += step1;
this.chart1.ChartAreas["ChartArea1"].AxisY.ScaleView.Zoom(lastPoint.Y+ zoomY, this.chart1.ChartAreas["ChartArea1"].AxisY.Maximum - zoomY);
chart1.ChartAreas[0].AxisX.LabelStyle.Format = "0";
@taW
c# mschart zooming
c# mschart zooming
edited Nov 11 at 9:41
asked Nov 11 at 8:10
kamran amingalvani
2918
2918
1
Hehe, this kind of Ping doesn't work. You need to a) know the current zoom center and your steps. Then the code should work. Always keep the center in the midle between zoom start and -end. If the center is at x=400 and the current zoom is at xstart= 100 you have a xdelta=300. For step=100 you can zoom to(origin-i*step, origin+i*step)
– TaW
Nov 11 at 8:29
@TaW my steps is different I have 3 mode in code . current zoom center showing by mouse click. please help me write this code .Thanks
– kamran amingalvani
Nov 11 at 8:44
1
I'll have a look later..
– TaW
Nov 11 at 13:00
I found the code a little confusing. My answer adresses the prime issue of wrong coordinates and shows a simple zooming scheme. Adapt as needed..!
– TaW
Nov 12 at 10:03
add a comment |
1
Hehe, this kind of Ping doesn't work. You need to a) know the current zoom center and your steps. Then the code should work. Always keep the center in the midle between zoom start and -end. If the center is at x=400 and the current zoom is at xstart= 100 you have a xdelta=300. For step=100 you can zoom to(origin-i*step, origin+i*step)
– TaW
Nov 11 at 8:29
@TaW my steps is different I have 3 mode in code . current zoom center showing by mouse click. please help me write this code .Thanks
– kamran amingalvani
Nov 11 at 8:44
1
I'll have a look later..
– TaW
Nov 11 at 13:00
I found the code a little confusing. My answer adresses the prime issue of wrong coordinates and shows a simple zooming scheme. Adapt as needed..!
– TaW
Nov 12 at 10:03
1
1
Hehe, this kind of Ping doesn't work. You need to a) know the current zoom center and your steps. Then the code should work. Always keep the center in the midle between zoom start and -end. If the center is at x=400 and the current zoom is at xstart= 100 you have a xdelta=300. For step=100 you can zoom to
(origin-i*step, origin+i*step)
– TaW
Nov 11 at 8:29
Hehe, this kind of Ping doesn't work. You need to a) know the current zoom center and your steps. Then the code should work. Always keep the center in the midle between zoom start and -end. If the center is at x=400 and the current zoom is at xstart= 100 you have a xdelta=300. For step=100 you can zoom to
(origin-i*step, origin+i*step)
– TaW
Nov 11 at 8:29
@TaW my steps is different I have 3 mode in code . current zoom center showing by mouse click. please help me write this code .Thanks
– kamran amingalvani
Nov 11 at 8:44
@TaW my steps is different I have 3 mode in code . current zoom center showing by mouse click. please help me write this code .Thanks
– kamran amingalvani
Nov 11 at 8:44
1
1
I'll have a look later..
– TaW
Nov 11 at 13:00
I'll have a look later..
– TaW
Nov 11 at 13:00
I found the code a little confusing. My answer adresses the prime issue of wrong coordinates and shows a simple zooming scheme. Adapt as needed..!
– TaW
Nov 12 at 10:03
I found the code a little confusing. My answer adresses the prime issue of wrong coordinates and shows a simple zooming scheme. Adapt as needed..!
– TaW
Nov 12 at 10:03
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Here is a solution that will zoom in 2x with each click.
It uses a variable span
as the range of values that will be visible in the zoomed view.
It also moves the clicked position to the next closest DataPoint
. You may remove this to allow zooming in on positions between DataPoints
.
Let's see it in action:
Note that the first issue with your code is the coordinates you use.
These are three (!) coordinate systems in MSChart
:
Pixels as inMouseClick
Values as inAxis
values
Positions as inElementPositions
i.e. percentages related to the next higher container
Your main issue is that you mix pixels with values which will result in chaos.
You need to convert the pixels to values as in the code shown.
Here are the variables I use:
double span = 0; // axis range in values
Point lastPoint = Point.Empty; // the clicked position
PointF clickedValues = PointF.Empty; // the values of the clicked positiom
DataPoint closePoint = null; // the next closest DataPoint
Now the click code with the conversion:
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
if (closePoint != null) closePoint.MarkerColor = chart1.Series[0].MarkerColor;
clickedValues = new PointF((float)ax.PixelPositionToValue(lastPoint.X),
(float)ay.PixelPositionToValue(lastPoint.Y));
closePoint = chart1.Series[0].Points.Where(x => x.XValue >= clickedValues .X).First();
closePoint.MarkerColor = Color.Red; // optionally mark the point
// optionally move clicked position to actual datapoint
nextDPoint = new PointF((float)closePoint.XValue, (float)closePoint.YValues[0]);
span = ax.Maximum - ax.Minimum; // the full range of values
Finally the code for the zoom-in button:
private void button1_Click(object sender, EventArgs e)
span /= 2; // zoom in 2x each time
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
ax.ScaleView.Zoom(nextDPoint.X - span, nextDPoint.X + span);
A few notes:
- The conversion functions are only available after the chart has finished layout.
- I only zoom the x-axis and I only zoom-in. Adding y-axis zoom and zooming-out should be simple..
- changing the speed or step size is also not rocket science. Note that the steps should be a factor to allow a good user experience. If you add (instead of multiply) the zooming will not look linear but will either get faster or slower with each step..
- Of course the markers and the visualization of the clicked points is optional and may not work well with your chart.
- I use a
PointF
to store the clicked values. Usuallyfloats
will do; this may not be true if the values areDateTime
, though. In such a case do use twodoubles
! - Note how I put the
Axis
into variables. I usually do the same withSeries
andChartAreas
. Much easier to write, read and I think even (a little) faster to run.. .
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Here is a solution that will zoom in 2x with each click.
It uses a variable span
as the range of values that will be visible in the zoomed view.
It also moves the clicked position to the next closest DataPoint
. You may remove this to allow zooming in on positions between DataPoints
.
Let's see it in action:
Note that the first issue with your code is the coordinates you use.
These are three (!) coordinate systems in MSChart
:
Pixels as inMouseClick
Values as inAxis
values
Positions as inElementPositions
i.e. percentages related to the next higher container
Your main issue is that you mix pixels with values which will result in chaos.
You need to convert the pixels to values as in the code shown.
Here are the variables I use:
double span = 0; // axis range in values
Point lastPoint = Point.Empty; // the clicked position
PointF clickedValues = PointF.Empty; // the values of the clicked positiom
DataPoint closePoint = null; // the next closest DataPoint
Now the click code with the conversion:
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
if (closePoint != null) closePoint.MarkerColor = chart1.Series[0].MarkerColor;
clickedValues = new PointF((float)ax.PixelPositionToValue(lastPoint.X),
(float)ay.PixelPositionToValue(lastPoint.Y));
closePoint = chart1.Series[0].Points.Where(x => x.XValue >= clickedValues .X).First();
closePoint.MarkerColor = Color.Red; // optionally mark the point
// optionally move clicked position to actual datapoint
nextDPoint = new PointF((float)closePoint.XValue, (float)closePoint.YValues[0]);
span = ax.Maximum - ax.Minimum; // the full range of values
Finally the code for the zoom-in button:
private void button1_Click(object sender, EventArgs e)
span /= 2; // zoom in 2x each time
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
ax.ScaleView.Zoom(nextDPoint.X - span, nextDPoint.X + span);
A few notes:
- The conversion functions are only available after the chart has finished layout.
- I only zoom the x-axis and I only zoom-in. Adding y-axis zoom and zooming-out should be simple..
- changing the speed or step size is also not rocket science. Note that the steps should be a factor to allow a good user experience. If you add (instead of multiply) the zooming will not look linear but will either get faster or slower with each step..
- Of course the markers and the visualization of the clicked points is optional and may not work well with your chart.
- I use a
PointF
to store the clicked values. Usuallyfloats
will do; this may not be true if the values areDateTime
, though. In such a case do use twodoubles
! - Note how I put the
Axis
into variables. I usually do the same withSeries
andChartAreas
. Much easier to write, read and I think even (a little) faster to run.. .
add a comment |
up vote
3
down vote
accepted
Here is a solution that will zoom in 2x with each click.
It uses a variable span
as the range of values that will be visible in the zoomed view.
It also moves the clicked position to the next closest DataPoint
. You may remove this to allow zooming in on positions between DataPoints
.
Let's see it in action:
Note that the first issue with your code is the coordinates you use.
These are three (!) coordinate systems in MSChart
:
Pixels as inMouseClick
Values as inAxis
values
Positions as inElementPositions
i.e. percentages related to the next higher container
Your main issue is that you mix pixels with values which will result in chaos.
You need to convert the pixels to values as in the code shown.
Here are the variables I use:
double span = 0; // axis range in values
Point lastPoint = Point.Empty; // the clicked position
PointF clickedValues = PointF.Empty; // the values of the clicked positiom
DataPoint closePoint = null; // the next closest DataPoint
Now the click code with the conversion:
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
if (closePoint != null) closePoint.MarkerColor = chart1.Series[0].MarkerColor;
clickedValues = new PointF((float)ax.PixelPositionToValue(lastPoint.X),
(float)ay.PixelPositionToValue(lastPoint.Y));
closePoint = chart1.Series[0].Points.Where(x => x.XValue >= clickedValues .X).First();
closePoint.MarkerColor = Color.Red; // optionally mark the point
// optionally move clicked position to actual datapoint
nextDPoint = new PointF((float)closePoint.XValue, (float)closePoint.YValues[0]);
span = ax.Maximum - ax.Minimum; // the full range of values
Finally the code for the zoom-in button:
private void button1_Click(object sender, EventArgs e)
span /= 2; // zoom in 2x each time
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
ax.ScaleView.Zoom(nextDPoint.X - span, nextDPoint.X + span);
A few notes:
- The conversion functions are only available after the chart has finished layout.
- I only zoom the x-axis and I only zoom-in. Adding y-axis zoom and zooming-out should be simple..
- changing the speed or step size is also not rocket science. Note that the steps should be a factor to allow a good user experience. If you add (instead of multiply) the zooming will not look linear but will either get faster or slower with each step..
- Of course the markers and the visualization of the clicked points is optional and may not work well with your chart.
- I use a
PointF
to store the clicked values. Usuallyfloats
will do; this may not be true if the values areDateTime
, though. In such a case do use twodoubles
! - Note how I put the
Axis
into variables. I usually do the same withSeries
andChartAreas
. Much easier to write, read and I think even (a little) faster to run.. .
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Here is a solution that will zoom in 2x with each click.
It uses a variable span
as the range of values that will be visible in the zoomed view.
It also moves the clicked position to the next closest DataPoint
. You may remove this to allow zooming in on positions between DataPoints
.
Let's see it in action:
Note that the first issue with your code is the coordinates you use.
These are three (!) coordinate systems in MSChart
:
Pixels as inMouseClick
Values as inAxis
values
Positions as inElementPositions
i.e. percentages related to the next higher container
Your main issue is that you mix pixels with values which will result in chaos.
You need to convert the pixels to values as in the code shown.
Here are the variables I use:
double span = 0; // axis range in values
Point lastPoint = Point.Empty; // the clicked position
PointF clickedValues = PointF.Empty; // the values of the clicked positiom
DataPoint closePoint = null; // the next closest DataPoint
Now the click code with the conversion:
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
if (closePoint != null) closePoint.MarkerColor = chart1.Series[0].MarkerColor;
clickedValues = new PointF((float)ax.PixelPositionToValue(lastPoint.X),
(float)ay.PixelPositionToValue(lastPoint.Y));
closePoint = chart1.Series[0].Points.Where(x => x.XValue >= clickedValues .X).First();
closePoint.MarkerColor = Color.Red; // optionally mark the point
// optionally move clicked position to actual datapoint
nextDPoint = new PointF((float)closePoint.XValue, (float)closePoint.YValues[0]);
span = ax.Maximum - ax.Minimum; // the full range of values
Finally the code for the zoom-in button:
private void button1_Click(object sender, EventArgs e)
span /= 2; // zoom in 2x each time
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
ax.ScaleView.Zoom(nextDPoint.X - span, nextDPoint.X + span);
A few notes:
- The conversion functions are only available after the chart has finished layout.
- I only zoom the x-axis and I only zoom-in. Adding y-axis zoom and zooming-out should be simple..
- changing the speed or step size is also not rocket science. Note that the steps should be a factor to allow a good user experience. If you add (instead of multiply) the zooming will not look linear but will either get faster or slower with each step..
- Of course the markers and the visualization of the clicked points is optional and may not work well with your chart.
- I use a
PointF
to store the clicked values. Usuallyfloats
will do; this may not be true if the values areDateTime
, though. In such a case do use twodoubles
! - Note how I put the
Axis
into variables. I usually do the same withSeries
andChartAreas
. Much easier to write, read and I think even (a little) faster to run.. .
Here is a solution that will zoom in 2x with each click.
It uses a variable span
as the range of values that will be visible in the zoomed view.
It also moves the clicked position to the next closest DataPoint
. You may remove this to allow zooming in on positions between DataPoints
.
Let's see it in action:
Note that the first issue with your code is the coordinates you use.
These are three (!) coordinate systems in MSChart
:
Pixels as inMouseClick
Values as inAxis
values
Positions as inElementPositions
i.e. percentages related to the next higher container
Your main issue is that you mix pixels with values which will result in chaos.
You need to convert the pixels to values as in the code shown.
Here are the variables I use:
double span = 0; // axis range in values
Point lastPoint = Point.Empty; // the clicked position
PointF clickedValues = PointF.Empty; // the values of the clicked positiom
DataPoint closePoint = null; // the next closest DataPoint
Now the click code with the conversion:
private void chart1_MouseClick(object sender, MouseEventArgs e)
lastPoint = e.Location;
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
if (closePoint != null) closePoint.MarkerColor = chart1.Series[0].MarkerColor;
clickedValues = new PointF((float)ax.PixelPositionToValue(lastPoint.X),
(float)ay.PixelPositionToValue(lastPoint.Y));
closePoint = chart1.Series[0].Points.Where(x => x.XValue >= clickedValues .X).First();
closePoint.MarkerColor = Color.Red; // optionally mark the point
// optionally move clicked position to actual datapoint
nextDPoint = new PointF((float)closePoint.XValue, (float)closePoint.YValues[0]);
span = ax.Maximum - ax.Minimum; // the full range of values
Finally the code for the zoom-in button:
private void button1_Click(object sender, EventArgs e)
span /= 2; // zoom in 2x each time
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
ax.ScaleView.Zoom(nextDPoint.X - span, nextDPoint.X + span);
A few notes:
- The conversion functions are only available after the chart has finished layout.
- I only zoom the x-axis and I only zoom-in. Adding y-axis zoom and zooming-out should be simple..
- changing the speed or step size is also not rocket science. Note that the steps should be a factor to allow a good user experience. If you add (instead of multiply) the zooming will not look linear but will either get faster or slower with each step..
- Of course the markers and the visualization of the clicked points is optional and may not work well with your chart.
- I use a
PointF
to store the clicked values. Usuallyfloats
will do; this may not be true if the values areDateTime
, though. In such a case do use twodoubles
! - Note how I put the
Axis
into variables. I usually do the same withSeries
andChartAreas
. Much easier to write, read and I think even (a little) faster to run.. .
edited Nov 14 at 5:38
answered Nov 12 at 10:02
TaW
40.5k62662
40.5k62662
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246913%2fzoom-in-zoom-out-from-a-point-mschart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Hehe, this kind of Ping doesn't work. You need to a) know the current zoom center and your steps. Then the code should work. Always keep the center in the midle between zoom start and -end. If the center is at x=400 and the current zoom is at xstart= 100 you have a xdelta=300. For step=100 you can zoom to
(origin-i*step, origin+i*step)
– TaW
Nov 11 at 8:29
@TaW my steps is different I have 3 mode in code . current zoom center showing by mouse click. please help me write this code .Thanks
– kamran amingalvani
Nov 11 at 8:44
1
I'll have a look later..
– TaW
Nov 11 at 13:00
I found the code a little confusing. My answer adresses the prime issue of wrong coordinates and shows a simple zooming scheme. Adapt as needed..!
– TaW
Nov 12 at 10:03