If you create a bar chart using some monthly data with a date along the xaxis and set the Increment to One Month you end up with a date (the month) against each bar are desired. However, if you then change the label angle to 90 teh asix goes to half month showing dates at the bars and the 15th of each month also.
Version 3.5.3061.15671
Bottom datatime axis increament set to One Month problems
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
I'm not able to reproduce the issue here using code below. Would you be so king to modify it or send us a simple example project we can run "as-is" to reproduce the issue here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I'm not able to reproduce the issue here using code below. Would you be so king to modify it or send us a simple example project we can run "as-is" to reproduce the issue here?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
Random y = new Random();
for (int i = 1; i <= 6; i++)
{
bar1.Add(DateTime.Parse("01/" + i.ToString() + "/2008"), y.Next());
}
tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneMonth);
tChart1.Axes.Bottom.Labels.DateTimeFormat = "MMMM";
tChart1.Axes.Bottom.Labels.Angle = 90;
}
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |
I will but I'm a bit pushed for time at the moment. You might like to try setting all the axis options using the editor, this is where the problem appears for me. So create a simple chart with several bars where the xvalyes are dates 01/Jan/2000, 01/Feb/2000 etc. then change the axis using the editor according to the above.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
Thanks for the information.
In that case it's most likely because you haven't set bottom axis Increment to be one month. I could reproduce the issue here using code below. Commenting out the Increment line works fine. At designtime you can set increment to 30, it's equivalent to DateTimeSteps.OneMonth.
Hope this helps!
Thanks for the information.
In that case it's most likely because you haven't set bottom axis Increment to be one month. I could reproduce the issue here using code below. Commenting out the Increment line works fine. At designtime you can set increment to 30, it's equivalent to DateTimeSteps.OneMonth.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
Random y = new Random();
for (int i = 1; i <= 6; i++)
{
bar1.Add(DateTime.Parse("01/" + i.ToString() + "/2008"), y.Next());
}
//tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneMonth);
tChart1.Axes.Bottom.Labels.DateTimeFormat = "MMMM";
tChart1.Axes.Bottom.Labels.Angle = 90;
}
Best Regards,
Narcís Calvet / 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 |
Hi Narcis,
In my application the charts are created at run time by the users. they specify what data source is to be used and which columns from the datasource are to be used for the x and Y columns. once this basic information is provided an initial chart is created. They then use the chart editor to specify formatting etc. It's this bit that is not working for One Month increments, I can't programatically set the One Month increment because I don't know what they want, it needs to be set via the chart editor by the user at run time but this is not working. I was working in previous releases... You have broken something in this latest release... If you set the Increment to TWO MONTHS it works... I'm thinking you have got an offset wrong somewhere.
In my application the charts are created at run time by the users. they specify what data source is to be used and which columns from the datasource are to be used for the x and Y columns. once this basic information is provided an initial chart is created. They then use the chart editor to specify formatting etc. It's this bit that is not working for One Month increments, I can't programatically set the One Month increment because I don't know what they want, it needs to be set via the chart editor by the user at run time but this is not working. I was working in previous releases... You have broken something in this latest release... If you set the Increment to TWO MONTHS it works... I'm thinking you have got an offset wrong somewhere.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
Thanks for the information. I could reproduce the problem here running the code snippet in my last post and then try to set bottom axis Increment to OneMonth at runtime using the chart editor. I've added the defect (TF02013063) to the bug list to be fixed for next releases. I have also been able to reproduce the issue here using 4th April release (Build 3.2.3016.15520/1/2). With which version did you get that working?
Thanks in advance.
Thanks for the information. I could reproduce the problem here running the code snippet in my last post and then try to set bottom axis Increment to OneMonth at runtime using the chart editor. I've added the defect (TF02013063) to the bug list to be fixed for next releases. I have also been able to reproduce the issue here using 4th April release (Build 3.2.3016.15520/1/2). With which version did you get that working?
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |