How to show data in pan rectangle to other chart?
How to show data in pan rectangle to other chart?
Hi everyone?
Have a nice day!
I am using teechart to make my historian trends. I have 2 charts, first one for full trend and second one for displays pan data from first one.
And I create a rectangle in first chart to get pan window. I want to display all data in pan window to show in second chart.
Has anyone got this code or has made the same with this issue?
Please, help me.
Thanks in advance!
Please, see the attach file
Have a nice day!
I am using teechart to make my historian trends. I have 2 charts, first one for full trend and second one for displays pan data from first one.
And I create a rectangle in first chart to get pan window. I want to display all data in pan window to show in second chart.
Has anyone got this code or has made the same with this issue?
Please, help me.
Thanks in advance!
Please, see the attach file
- Attachments
-
- I want to make like this image
- Pan.jpg (111.11 KiB) Viewed 10925 times
Re: How to show data in pan rectangle to other chart?
Hi tomking,
Here you have a simple example:
Here you have a simple example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
FastLine fast1, fast2;
ColorBand colorband1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart2.Aspect.View3D = false;
tChart1.Legend.Visible = false;
tChart2.Legend.Visible = false;
fast1 = new FastLine(tChart1.Chart);
fast2 = new FastLine(tChart2.Chart);
fast1.FillSampleValues(200);
fast2.DataSource = fast1;
colorband1 = new ColorBand(tChart2.Chart);
colorband1.Axis = tChart2.Axes.Bottom;
colorband1.Pen.Color = Color.Red;
colorband1.Transparency = 50;
colorband1.Start = 50;
colorband1.End = 150;
colorband1.ResizeStart = true;
colorband1.ResizeEnd = true;
colorband1.StartLine.DragLine += new EventHandler(ColorBand_DragLine);
colorband1.EndLine.DragLine += new EventHandler(ColorBand_DragLine);
}
void ColorBand_DragLine(object sender, EventArgs e)
{
tChart1.Axes.Bottom.SetMinMax(colorband1.Start, colorband1.End);
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to show data in pan rectangle to other chart?
Hi Yeray Alonso
Thank you very much!
Your sample is very nice. But I want to create pan window by RECTANGLE because I want to DRAG and RESIZE on both side (Vertical, Horizontal, Both).
Could you please help me?
Thanks
Please, see the attach image!
Thank you very much!
Your sample is very nice. But I want to create pan window by RECTANGLE because I want to DRAG and RESIZE on both side (Vertical, Horizontal, Both).
Could you please help me?
Thanks
Please, see the attach image!
- Attachments
-
- pan3.jpg (120.88 KiB) Viewed 10885 times
Re: How to show data in pan rectangle to other chart?
Hi
In that case you should do something similar to the above but you could use a RectangleTool that allows dragging and resizing in all directions. And you should also do a SetMinMax for the left axis too. Here is an example:
In that case you should do something similar to the above but you could use a RectangleTool that allows dragging and resizing in all directions. And you should also do a SetMinMax for the left axis too. Here is an example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
FastLine fast1, fast2;
RectangleTool rectangle1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart2.Aspect.View3D = false;
tChart1.Legend.Visible = false;
tChart2.Legend.Visible = false;
fast1 = new FastLine(tChart1.Chart);
fast2 = new FastLine(tChart2.Chart);
fast1.FillSampleValues(200);
fast2.DataSource = fast1;
rectangle1 = new RectangleTool(tChart2.Chart);
rectangle1.Shape.Pen.Color = Color.Red;
rectangle1.Shape.Transparency = 50;
rectangle1.AllowDrag = true;
rectangle1.AllowResize = true;
rectangle1.Dragging += new RectangleToolDraggingEventHandler(rectangle1_Recalc);
rectangle1.Resizing += new RectangleToolResizingEventHandler(rectangle1_Recalc);
rectangle1.Left = 50;
rectangle1.Top = 50;
rectangle1.Width = 100;
rectangle1.Height = 100;
}
void rectangle1_Recalc(object sender, EventArgs e)
{
tChart1.Axes.Bottom.SetMinMax(tChart2.Axes.Bottom.CalcPosPoint(rectangle1.Left), tChart2.Axes.Bottom.CalcPosPoint(rectangle1.Left + rectangle1.Width));
tChart1.Axes.Left.SetMinMax(tChart2.Axes.Left.CalcPosPoint(rectangle1.Top + rectangle1.Height), tChart2.Axes.Left.CalcPosPoint(rectangle1.Top));
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to show data in pan rectangle to other chart?
Hi Yeray Alonso !
That is function I need.
Thank you very much!
Best regards
That is function I need.
Thank you very much!
Best regards
Re: How to show data in pan rectangle to other chart?
Hi Yeray Alonso !
How can I set the area limitation of rectangle only in DATA AREA like below image?
(If I don't set limitation the rectangle will exceed DATA AREA when I drag or resize)
Could you help me?
Thank you very much!
Best regards
How can I set the area limitation of rectangle only in DATA AREA like below image?
(If I don't set limitation the rectangle will exceed DATA AREA when I drag or resize)
Could you help me?
Thank you very much!
Best regards
- Attachments
-
- pan2.jpg (120.62 KiB) Viewed 10848 times
Re: How to show data in pan rectangle to other chart?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to show data in pan rectangle to other chart?
Hi Yeray Alonso !
It is not correct. Can you review?
Thanks
It is not correct. Can you review?
Thanks
Re: How to show data in pan rectangle to other chart?
Hi tomking,
I can't reproduce it with the code I posted above. Could you please send us a simple example project we can run as-is to reproduce the problem here?
I can't reproduce it with the code I posted above. Could you please send us a simple example project we can run as-is to reproduce the problem here?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |