Page 1 of 1

Language of datetimeformat

Posted: Wed May 28, 2014 12:34 pm
by 15654539
When you set the property
chart.Axes.Bottom.Labels.DateTimeFormat = "dddd"
In my computer the day of the week is shown in spanish. I would like to configurate the language of my application in my application. Where take teechart the language from?

Thanks

Re: Language of datetimeformat

Posted: Wed May 28, 2014 1:36 pm
by Christopher
wakeup wrote:When you set the property
chart.Axes.Bottom.Labels.DateTimeFormat = "dddd"
In my computer the day of the week is shown in spanish. I would like to configurate the language of my application in my application. Where take teechart the language from?
Following the MSDN documentation for DateTime.ToString method, you can use:

Code: Select all

    private void button1_Click(object sender, EventArgs e)
    {
      Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
      MessageBox.Show(DateTime.Today.ToString("dddd"));
    }

Re: Language of datetimeformat

Posted: Wed May 28, 2014 1:39 pm
by 15654539
The instruction for giving to teechart the time format is chart.Axes.Bottom.Labels.DateTimeFormat = "dddd" , not "toString" possibility here...

Re: Language of datetimeformat

Posted: Wed May 28, 2014 1:54 pm
by Christopher
wakeup wrote:The instruction for giving to teechart the time format is chart.Axes.Bottom.Labels.DateTimeFormat = "dddd" , not "toString" possibility here...
Have you tried adding the line:

Code: Select all

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
before the line:

Code: Select all

chart.Axes.Bottom.Labels.DateTimeFormat = "dddd"
in your code?

Re: Language of datetimeformat

Posted: Thu May 29, 2014 6:32 am
by 15654539
Thanks, it runs, but this change does also other changes in the application like change the decimal separator, in the numeric fileds of the applicaion. Is not possible only to change the language of the datetime format?

Thanks

Re: Language of datetimeformat

Posted: Thu May 29, 2014 7:23 am
by Christopher
wakeup wrote:Thanks, it runs, but this change does also other changes in the application like change the decimal separator, in the numeric fileds of the applicaion. Is not possible only to change the language of the datetime format?
This is not a TeeChart issue, but a .NET Framework issue. As far as I know, changing the CurrentCulture is the only way to change the language the .NET Framework uses to display DateTime values.