Zooming of Annotation tool
Zooming of Annotation tool
Hi,
I have used the Annotation tool for highlighting a section of data in my chart control.
I have 10 Fastline series data. User can move the mouse at the bottom of the control to select or highlight a section of data.
I have to provide the top, left, height and width to the Annotation tool for highlighting the data.
See the image below. Now, when i am zooming the trend control - the Annotation tool is not getting resized. In the below image, i have zoomed the data but the Annotation tool is still of same size. In the RectangleTool this problem is not there. It is only specific to Annotation tool.
Can you suggest me a way to solve this problem.
Regards,
Avijit
I have used the Annotation tool for highlighting a section of data in my chart control.
I have 10 Fastline series data. User can move the mouse at the bottom of the control to select or highlight a section of data.
I have to provide the top, left, height and width to the Annotation tool for highlighting the data.
See the image below. Now, when i am zooming the trend control - the Annotation tool is not getting resized. In the below image, i have zoomed the data but the Annotation tool is still of same size. In the RectangleTool this problem is not there. It is only specific to Annotation tool.
Can you suggest me a way to solve this problem.
Regards,
Avijit
Re: Zooming of Annotation tool
Hi Avijit,
First of all, I'd like to suggest you to use a ColorBandTool that, if I understand you well, was designed for doing what are you exactly trying to achieve.
And with annotations, the problem is that you have to reposition them each time the chart is resized or repainted using positions relative to the chart. For example, for the Zoom you could use Zoomed event:
And do something like this:
First of all, I'd like to suggest you to use a ColorBandTool that, if I understand you well, was designed for doing what are you exactly trying to achieve.
And with annotations, the problem is that you have to reposition them each time the chart is resized or repainted using positions relative to the chart. For example, for the Zoom you could use Zoomed event:
Code: Select all
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
Code: Select all
void tChart1_Zoomed(object sender, EventArgs e)
{
tChart1.Draw();
RecalcAnnotation();
}
private void RecalcAnnotation()
{
annot1.Left = tChart1.Axes.Bottom.CalcPosValue(5);
annot1.Width = tChart1.Axes.Bottom.CalcPosValue(10) - annot1.Left;
annot1.Top = tChart1.Axes.Left.IStartPos;
annot1.Height = tChart1.Axes.Left.IEndPos - annot1.Top;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Zooming of Annotation tool
Hi Yeray,
Please let me know if i can specify the left, width, top and height of the ColorBand tool.
Please have a look at the screenshot below from our own product that has been developed using MFC-
Now let me know if it is possible to use the ColorBand tool to do these kind of highlightings in TeeChart control.
I think ColorBand tool is always associates with a axis. It is really a disadvantage of the usage of the tool.
For the markings shown in the screen shot i have to specify the left, width, top and height for the tool.
Please let me know if you have any alternative solutions for this problem.
Also please allow the users to specify the left, width,top and height of the ColorBand tool. It is really required.
Regards,
Avijit
Please let me know if i can specify the left, width, top and height of the ColorBand tool.
Please have a look at the screenshot below from our own product that has been developed using MFC-
Now let me know if it is possible to use the ColorBand tool to do these kind of highlightings in TeeChart control.
I think ColorBand tool is always associates with a axis. It is really a disadvantage of the usage of the tool.
For the markings shown in the screen shot i have to specify the left, width, top and height for the tool.
Please let me know if you have any alternative solutions for this problem.
Also please allow the users to specify the left, width,top and height of the ColorBand tool. It is really required.
Regards,
Avijit
Re: Zooming of Annotation tool
Hi,
Is it possible to specify the left, top, width and height of a Rectangle tool or Annotation tool in float?
Presently it is only accepting integers.
How can i specify the points as float?
Regards,
Avijit
Is it possible to specify the left, top, width and height of a Rectangle tool or Annotation tool in float?
Presently it is only accepting integers.
How can i specify the points as float?
Regards,
Avijit
Re: Zooming of Annotation tool
Hi Avijit,
Yes, as you've noticed, ColorBandTool was designed to be assigned to an axis so that it could highlight the whole width or the whole height (depending of if the axis is horizontal or vertical) from a value to another value.
As you need a rectangle, you need the rectangle tool or the annotation tool and you have to reposition it relatively to the chart axes. For example:
Yes, as you've noticed, ColorBandTool was designed to be assigned to an axis so that it could highlight the whole width or the whole height (depending of if the axis is horizontal or vertical) from a value to another value.
As you need a rectangle, you need the rectangle tool or the annotation tool and you have to reposition it relatively to the chart axes. For example:
Code: Select all
Steema.TeeChart.Styles.Line line1;
Steema.TeeChart.Tools.RectangleTool rectangle1;
private void InitializeChart()
{
chartController1.Chart = tChart1;
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Random rnd = new Random();
line1.Add(1000);
for (int i = 1; i < 25; i++)
{
line1.Add(line1.YValues.Value[i - 1] + rnd.Next(10));
}
rectangle1 = new Steema.TeeChart.Tools.RectangleTool(tChart1.Chart);
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Draw();
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
rectangle1.Left = tChart1.Axes.Bottom.CalcPosValue(10);
rectangle1.Width = tChart1.Axes.Bottom.CalcPosValue(15) - rectangle1.Left;
rectangle1.Top = tChart1.Axes.Left.CalcPosValue(1070);
rectangle1.Height = tChart1.Axes.Left.CalcPosValue(1050) - rectangle1.Top;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Zooming of Annotation tool
Hello,
I just saw that the ColorBand tool does not occupy the Axis offset area. Is that intended?
For one fastline series i set the offset to 25%.
I have one ColorBand tool associated with the Custom Vertical axis of the fastline series.
I am seeing the ColorBand tool occupying only 50% of the Custom axis height.
Please let me know how to solve this issue.
Regards,
Avijit
I just saw that the ColorBand tool does not occupy the Axis offset area. Is that intended?
For one fastline series i set the offset to 25%.
I have one ColorBand tool associated with the Custom Vertical axis of the fastline series.
I am seeing the ColorBand tool occupying only 50% of the Custom axis height.
Please let me know how to solve this issue.
Regards,
Avijit
Re: Zooming of Annotation tool
Hi Avijit,
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
I'm not sure to understand what exact offset you have set to 25%.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
I'm not sure to understand what exact offset you have set to 25%.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Zooming of Annotation tool
Hello Yerey,
Please see the attached project. I have created one ColorBand tool and associated with a vertical custom axis and added offset to the Axis. See the ColorBand is not starting from the begining of the Axis nor it is ending at the end of the axis.
-Avijit
Please see the attached project. I have created one ColorBand tool and associated with a vertical custom axis and added offset to the Axis. See the ColorBand is not starting from the begining of the Axis nor it is ending at the end of the axis.
-Avijit
- Attachments
-
- OffsetProb.zip
- (12.73 KiB) Downloaded 715 times
Re: Zooming of Annotation tool
Hi,
One more thing i want to know.
Is it possible to calculate the Start and End position of the ColorBand tool without calling the TChart.Draw() function?
This might be a performance issue in our case.
-Avijit
One more thing i want to know.
Is it possible to calculate the Start and End position of the ColorBand tool without calling the TChart.Draw() function?
This might be a performance issue in our case.
-Avijit
Re: Zooming of Annotation tool
Hello Avijit,
I have checked your application, and I seem that ColorBand doesn't paint correctly, because you initialize Minimum and Maximum Offsets of custom axis to 25% and ColorBand behaves according to the axis where is assigned. So if you want that ColorBand paint full, you will need change Offset of custom axis by default. You could modify your code so:
So, I think if you remove this line, your application will work fine.
I hope will helps.
Thanks,
I have checked your application, and I seem that ColorBand doesn't paint correctly, because you initialize Minimum and Maximum Offsets of custom axis to 25% and ColorBand behaves according to the axis where is assigned. So if you want that ColorBand paint full, you will need change Offset of custom axis by default. You could modify your code so:
Code: Select all
public void DrawTrend()
{
FastLine _FastLIne = new FastLine();
_FastLIne.FillSampleValues(100);
Axis _Axis = new Axis();
ChartControl.Axes.Custom.Add(_Axis);
_Axis.StartEndPositionUnits = PositionUnits.Percent;
_Axis.StartPosition = 0;
_Axis.EndPosition = 100;
//_Axis.MaximumOffset = 25;
//_Axis.MinimumOffset = 25;
_FastLIne.CustomVertAxis = _Axis;
ChartControl.Series.Add(_FastLIne);
_Axis.Automatic = true;
_Axis.SetMinMax(_FastLIne.MinYValue(), _FastLIne.MaxYValue());
...
I check your code and I removed next line in DrawTrend(),because it is not necessary, for calculate start and end position of ColorBandTool :Hi,
One more thing i want to know.
Is it possible to calculate the Start and End position of the ColorBand tool without calling the TChart.Draw() function?
This might be a performance issue in our case.
Code: Select all
ChartControl.Draw();//is not necessary
I hope will helps.
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 |
Re: Zooming of Annotation tool
Hello Sandra,
I removed the line. But now the colorbands are not getting drawn.
While checking the Axis sizes, i came to know that the Custom Axis IStartPos, IEndPos and IAxisSize is ZERO before calling the ChartControl.Draw function.
Please, let me know how to solve this.
Regards,
Avijit
I removed the line. But now the colorbands are not getting drawn.
While checking the Axis sizes, i came to know that the Custom Axis IStartPos, IEndPos and IAxisSize is ZERO before calling the ChartControl.Draw function.
Please, let me know how to solve this.
Regards,
Avijit
Re: Zooming of Annotation tool
Hello Avijit,
I have tested again it and I confirm that here, previous code works fine with last version of TeeChart .Net. Can you please, tell us what version of TeeChart.Net you are using? Because, we can try to find a solution for it.
Thanks,
I have tested again it and I confirm that here, previous code works fine with last version of TeeChart .Net. Can you please, tell us what version of TeeChart.Net you are using? Because, we can try to find a solution for it.
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 |
Re: Zooming of Annotation tool
Hello,
i am using
Version - 4.0.0.30764
Regards,
Avijit
i am using
Version - 4.0.0.30764
Regards,
Avijit
Re: Zooming of Annotation tool
Hello Avijit,
I recommend you, update your version 4 of TeeChart .Net for last version 4 release that could download in this link. When you've updated version, you could check again, if my previous code works as you want.
Thanks,
I recommend you, update your version 4 of TeeChart .Net for last version 4 release that could download in this link. When you've updated version, you could check again, if my previous code works as you want.
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 |
Re: Zooming of Annotation tool
Hello Sandra,
I have installed the latest release (4th August, 2010)
I commented out the Offset part.
Also commented out the ChartControl.Draw().
As i told you, ColorBand tool is not at getting drawn at all.
For the Custom Axis - IStartPos, IEndPos and IAxisSize is ZERO now.
Please run the attached project as is and see for yourself.
regards,
Avijit
I have installed the latest release (4th August, 2010)
I commented out the Offset part.
Also commented out the ChartControl.Draw().
As i told you, ColorBand tool is not at getting drawn at all.
For the Custom Axis - IStartPos, IEndPos and IAxisSize is ZERO now.
Please run the attached project as is and see for yourself.
regards,
Avijit
- Attachments
-
- OffsetProb.zip
- NoColorBand
- (22.56 KiB) Downloaded 706 times