I was hoping that the positioning of the Header and Footer would be as simple as positioning the Legend with the LegendAlignments.
We are trying to mimic the same behavior options for the Header and Footer as the Legend, but the API is much more flexible with the Custom Positioning option.
We will need the header and footer to move appropriately when the user changes the position from Bottom Left, Bottom Right, Bottom Center for example .
(these are options we are customizing for our user)
I have turned off the autosize and turned on the custom positioning and it appears to read my values when I set Left, Bottom, Top and Right. But I must be setting them incorrectly.
How should I be specifying the position of the SubFooter for example if I want it to be on the Bottom Right of the chart, it should remain in the relative position as the chart resizes. (therefore no fixed values)
Any help is appreciated.
Custom position API for Header Footer and Sub Footer
Re: Custom position API for Header Footer and Sub Footer
Hello elby,
When you use custom position of Header or Footer and you want change TextAling you need modify its left and top position, because text have been aligned to right, center or left. I have made a simple example that I think you can use in your application:
Could you please, tell us if previous code works as you want?
I hope will helps.
Thanks,
When you use custom position of Header or Footer and you want change TextAling you need modify its left and top position, because text have been aligned to right, center or left. I have made a simple example that I think you can use in your application:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
comboBox1.Items.AddRange(new object[] { "Center","Left","Right"});
bar1.FillSampleValues();
tChart1.Footer.Visible = true;
tChart1.Footer.CustomPosition = true;
tChart1.Header.CustomPosition = true;
tChart1.Footer.Text = "TeeChart for .net version 4";
tChart1.Header.Text = "My Chart";
tChart1.Panel.MarginBottom = 10;
tChart1.Panel.MarginTop = 10;
comboBox1.SelectedIndex = 0;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBox1.SelectedIndex)
{
case 0:
tChart1.Header.Left = (int)tChart1.Axes.Left.Maximum;
tChart1.Header.Left = (int)tChart1.Axes.Bottom.IAxisSize / 2;
tChart1.Header.Top = 0;
tChart1.Footer.Top = tChart1.Axes.Left.CalcPosValue(0) 20;//You choose where is drawn.
tChart1.Footer.Left = (int)tChart1.Axes.Bottom.IAxisSize / 2;
tChart1.Header.TextAlign = StringAlignment.Center;
break;
case 1:
tChart1.Header.Left = (int)tChart1.Axes.Left.Maximum;
tChart1.Header.Left = (int)tChart1.Axes.Bottom.CalcPosValue(0);
tChart1.Header.Top = 0;
tChart1.Footer.Top = tChart1.Axes.Left.CalcPosValue(0) 20;//You choose where is drawn.
tChart1.Footer.Left = (int)tChart1.Axes.Bottom.CalcPosValue(0);
tChart1.Header.TextAlign = StringAlignment.Far;
break;
case 2 :
tChart1.Header.Left = (int)tChart1.Axes.Left.Maximum;
tChart1.Header.Left = (int)tChart1.Axes.Bottom.IAxisSize;
tChart1.Header.Top = 0;
tChart1.Footer.Top = tChart1.Axes.Left.CalcPosValue(0) 20;//You choose where is drawn.
tChart1.Footer.Left = (int)tChart1.Axes.Bottom.IAxisSize;
tChart1.Header.TextAlign = StringAlignment.Near;
break;
}
}
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: Custom position API for Header Footer and Sub Footer
What version of TChart was used for this implementation.
The version I have has Header.TextAlign as a TextAlignment not a StringAlignment?
I am using TeeChartNET2010VSNET2010_4.1.2010.08043.
The version I have has Header.TextAlign as a TextAlignment not a StringAlignment?
I am using TeeChartNET2010VSNET2010_4.1.2010.08043.
Re: Custom position API for Header Footer and Sub Footer
Hello elby,
Ok, I have checked that version with you are working, use StringAlignment, as next line:
Thanks,
I have been used for implementation my code, the last maintenance release TeeChart for .NET v2010 [28 SEP 2010] RELEASE 4.1.2010.09280, please see this post.What version of TChart was used for this implementation.
The version I have has Header.TextAlign as a TextAlignment not a StringAlignment?I am using TeeChartNET2010VSNET2010_4.1.2010.08043
Ok, I have checked that version with you are working, use StringAlignment, as next line:
Code: Select all
tChart1.Header.TextAlign = StringAlignment.Near;
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: Custom position API for Header Footer and Sub Footer
Hi.,
We are currently referencing following assembly TeeChart.WPF.dll version 4.1.2011.4191.
I am still unable to see such an enum StringAlignments for positioning the Header and Footer to left/center/right...
Can you attach a complete example (Zipped) so that I compare references?
We are currently referencing following assembly TeeChart.WPF.dll version 4.1.2011.4191.
I am still unable to see such an enum StringAlignments for positioning the Header and Footer to left/center/right...
Can you attach a complete example (Zipped) so that I compare references?
Re: Custom position API for Header Footer and Sub Footer
Example does not appear to work...
I am attached a running sample that demonstrates the problem i see.
Regards.
I am attached a running sample that demonstrates the problem i see.
Regards.
- Attachments
-
- SteemaHeaderFooterAlignmentIssue.zip
- (46.42 KiB) Downloaded 488 times
Re: Custom position API for Header Footer and Sub Footer
Hello elby,
Ok. I have modified your project and works fine for me, using TextAlign. Can you please, check if your problem still appears with modifications. If problem still appears, please explain exactly,step to step how we can reproduce it here, so we can try to help you to find a solution for you. Thanks,
Ok. I have modified your project and works fine for me, using TextAlign. Can you please, check if your problem still appears with modifications. If problem still appears, please explain exactly,step to step how we can reproduce it here, so we can try to help you to find a solution for you. 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: Custom position API for Header Footer and Sub Footer
Hi. Sandra,
Your updated project does not have an TeeChart reference. So it does not compile?
When I reference the TeeChart.WPF.dll version we have it does not work!
Is there a different package we should be using?
Your updated project does not have an TeeChart reference. So it does not compile?
When I reference the TeeChart.WPF.dll version we have it does not work!
Is there a different package we should be using?
Re: Custom position API for Header Footer and Sub Footer
Hello elby,
I inform you, there is a new release of TeeChart.Net and I recommend you update your versio. You can download in Custom download Page. On the other hand, I have attached again the project and you need know that I have removed my reference of TeeChart to decrease the size of the file. To compile and run the project, you only have to follow next steps:
- Open the project
- Add your TeeChart.Wpf.dll.
- Rebuild the project and run.
If this still works please let me know.
Thanks,
I inform you, there is a new release of TeeChart.Net and I recommend you update your versio. You can download in Custom download Page. On the other hand, I have attached again the project and you need know that I have removed my reference of TeeChart to decrease the size of the file. To compile and run the project, you only have to follow next steps:
- Open the project
- Add your TeeChart.Wpf.dll.
- Rebuild the project and run.
If this still works please let me know.
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 |