When not zoomed in, I am able to drag a point to the edges of the chart limit, and the chart will expand and move with my point.
For example, if my Y-axis was from 0 to 120 and I drag a point from 100 to 200, the chart would previously expand to 200.
However, when I am zoomed in, the chart does not expand automatically. Is there a setting I am missing or is this a known issue?
Thanks
DragPoint not extending outside of chart view after zooming
Hello LibDundas,
I recomend use similar code for next example:
InitializeChart:
Drag Event:
I hope you will help
Thanks,
I recomend use similar code for next example:
InitializeChart:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Pointer.Visible = true;
Steema.TeeChart.Tools.DragPoint dgpoint = new Steema.TeeChart.Tools.DragPoint(tChart1.Chart);
line1.FillSampleValues();
dgpoint.Series = line1;
dgpoint.Drag += new Steema.TeeChart.Tools.DragPointEventHandler(dgpoint_Drag);
}
Code: Select all
void dgpoint_Drag(Steema.TeeChart.Tools.DragPoint sender, int index)
{
Steema.TeeChart.Styles.Series s = sender.Series;
double x = s.XValues[index];
double y = s.YValues[index];
if (x > s.GetHorizAxis.Maximum)
s.GetHorizAxis.Maximum = x;
if (x < s.GetHorizAxis.Minimum)
s.GetHorizAxis.Minimum = x;
if (y > s.GetVertAxis.Maximum)
s.GetVertAxis.Maximum = x;
if (y < s.GetVertAxis.Minimum)
s.GetVertAxis.Minimum = x;
}
I hope you will help
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Thank you Sandra! I added in your suggestion and it worked as expected. Just 2 small typos that I corrected below to help any future readers of this post:
Drag Event:
if (x > s.GetHorizAxis.Maximum)
s.GetHorizAxis.Maximum = x;
if (x < s.GetHorizAxis.Minimum)
s.GetHorizAxis.Minimum = x;
if (y > s.GetVertAxis.Maximum)
s.GetVertAxis.Maximum = y;
if (y < s.GetVertAxis.Minimum)
s.GetVertAxis.Minimum = y;
Hello LibDundas,
Thanks, I had not realized .
Thanks, I had not realized .
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |