Closed Thread
Results 1 to 4 of 4

NumberFormat for date axis is not working

Hybrid View

Guest NumberFormat for date axis is... 08-21-2006, 04:25 AM
Guest Re: NumberFormat for date... 08-21-2006, 11:35 AM
Guest Re: NumberFormat for date... 08-22-2006, 05:05 PM
Guest Re: NumberFormat for date... 08-22-2006, 08:00 PM
  1. #1
    Ian Hannah
    Guest

    NumberFormat for date axis is not working


    I am using OWC10 for creating a chart in ASP.NET. I am suing data read from
    a SQL Database and I am creating a Y axis and an X axis. The graph is
    displaying data read at a number of different dates over a date range. The x
    axis is displaying the dates.

    The problem I am having is that the date format is always MM/DD/YYYY
    regardless of how the NumberFormat is set i.e. dates are always in US format.
    I have noticed that if I set the enumeration to either auto or manual the
    dates show in the correct format but the graph it wrong. If I set it to
    NumberFormatEnum.None then the graph is correct but the date format is wrong.

    Does anyone know what I am doing wrong or is there a bug in setting the
    NumberFormat?

    Ian H


  2. #2
    Peter T
    Guest

    Re: NumberFormat for date axis is not working

    Hi Ian,

    I have an addin that removes all links in chart(s) to cells, series data to
    named arrays and values into labels and other things. Like you I found
    handling International date formats a problem with labels (unlike cells).

    After doing some work to see if the potential problem will occur I
    workaround by adding a space to the date before writing to the label value.
    The label's numberformat remains unchanged (eg international date) and if
    the label's value is read back it automatically gets reconverted to the
    'true' date. Not entirely satisfactory but works well enough.

    Regards,
    Peter T

    As a workaround, having established the
    "Ian Hannah" <IanHannah@discussions.microsoft.com> wrote in message
    news:D4976F46-2406-4424-9928-7C4B1BE7CB42@microsoft.com...
    >
    > I am using OWC10 for creating a chart in ASP.NET. I am suing data read

    from
    > a SQL Database and I am creating a Y axis and an X axis. The graph is
    > displaying data read at a number of different dates over a date range. The

    x
    > axis is displaying the dates.
    >
    > The problem I am having is that the date format is always MM/DD/YYYY
    > regardless of how the NumberFormat is set i.e. dates are always in US

    format.
    > I have noticed that if I set the enumeration to either auto or manual the
    > dates show in the correct format but the graph it wrong. If I set it to
    > NumberFormatEnum.None then the graph is correct but the date format is

    wrong.
    >
    > Does anyone know what I am doing wrong or is there a bug in setting the
    > NumberFormat?
    >
    > Ian H
    >




  3. #3
    Sputnik
    Guest

    Re: NumberFormat for date axis is not working

    Hi Peter,

    Adding the space shows the whole date but I want to change the date
    format.

    This is what I am doing:

    // Add the dates to the array
    rgDates.Add(SqlData.GetDateTime(idxDate));

    // Set the dates
    Series.SetData(ChartDimensionsEnum.chDimCategories,
    (int)ChartSpecialDataSourcesEnum.chDataLiteral,
    rgDates.ToArray());

    DateAxis.HasTitle = true;
    DateAxis.NumberFormat = "MM/YYYY"

    DateAxis.GroupingType = ChartAxisGroupingEnum.chAxisGroupingNone;
    // DateAxis.GroupingType = ChartAxisGroupingEnum.chAxisGroupingAuto;

    If I comment out the chAxisGroupingNone line and uncomment the line
    below then the date formatting works and I have no idea why!

    Ian


    Peter T wrote:
    > Hi Ian,
    >
    > I have an addin that removes all links in chart(s) to cells, series data to
    > named arrays and values into labels and other things. Like you I found
    > handling International date formats a problem with labels (unlike cells).
    >
    > After doing some work to see if the potential problem will occur I
    > workaround by adding a space to the date before writing to the label value.
    > The label's numberformat remains unchanged (eg international date) and if
    > the label's value is read back it automatically gets reconverted to the
    > 'true' date. Not entirely satisfactory but works well enough.
    >
    > Regards,
    > Peter T
    >
    > As a workaround, having established the
    > "Ian Hannah" <IanHannah@discussions.microsoft.com> wrote in message
    > news:D4976F46-2406-4424-9928-7C4B1BE7CB42@microsoft.com...
    > >
    > > I am using OWC10 for creating a chart in ASP.NET. I am suing data read

    > from
    > > a SQL Database and I am creating a Y axis and an X axis. The graph is
    > > displaying data read at a number of different dates over a date range. The

    > x
    > > axis is displaying the dates.
    > >
    > > The problem I am having is that the date format is always MM/DD/YYYY
    > > regardless of how the NumberFormat is set i.e. dates are always in US

    > format.
    > > I have noticed that if I set the enumeration to either auto or manual the
    > > dates show in the correct format but the graph it wrong. If I set it to
    > > NumberFormatEnum.None then the graph is correct but the date format is

    > wrong.
    > >
    > > Does anyone know what I am doing wrong or is there a bug in setting the
    > > NumberFormat?
    > >
    > > Ian H
    > >



  4. #4
    Peter T
    Guest

    Re: NumberFormat for date axis is not working

    Hi Ian,

    Ah, somehow despite the fact you clearly said Axis somehow I read Labels!

    I can only think that was because I don't have a problem with International
    date format in Axes but I certainly do when writing to Label values.

    I also assumed you were working with an 'Excel' chart but it seems you are
    working with an Office Web Component, anything here -

    http://support.microsoft.com/kb/289288/

    Regards,
    Peter T

    "Sputnik" <id_hannah@hotmail.com> wrote in message
    news:1156280274.120757.235980@m73g2000cwd.googlegroups.com...
    > Hi Peter,
    >
    > Adding the space shows the whole date but I want to change the date
    > format.
    >
    > This is what I am doing:
    >
    > // Add the dates to the array
    > rgDates.Add(SqlData.GetDateTime(idxDate));
    >
    > // Set the dates
    > Series.SetData(ChartDimensionsEnum.chDimCategories,
    > (int)ChartSpecialDataSourcesEnum.chDataLiteral,
    > rgDates.ToArray());
    >
    > DateAxis.HasTitle = true;
    > DateAxis.NumberFormat = "MM/YYYY"
    >
    > DateAxis.GroupingType = ChartAxisGroupingEnum.chAxisGroupingNone;
    > // DateAxis.GroupingType = ChartAxisGroupingEnum.chAxisGroupingAuto;
    >
    > If I comment out the chAxisGroupingNone line and uncomment the line
    > below then the date formatting works and I have no idea why!
    >
    > Ian
    >
    >
    > Peter T wrote:
    > > Hi Ian,
    > >
    > > I have an addin that removes all links in chart(s) to cells, series data

    to
    > > named arrays and values into labels and other things. Like you I found
    > > handling International date formats a problem with labels (unlike

    cells).
    > >
    > > After doing some work to see if the potential problem will occur I
    > > workaround by adding a space to the date before writing to the label

    value.
    > > The label's numberformat remains unchanged (eg international date) and

    if
    > > the label's value is read back it automatically gets reconverted to the
    > > 'true' date. Not entirely satisfactory but works well enough.
    > >
    > > Regards,
    > > Peter T
    > >
    > > As a workaround, having established the
    > > "Ian Hannah" <IanHannah@discussions.microsoft.com> wrote in message
    > > news:D4976F46-2406-4424-9928-7C4B1BE7CB42@microsoft.com...
    > > >
    > > > I am using OWC10 for creating a chart in ASP.NET. I am suing data read

    > > from
    > > > a SQL Database and I am creating a Y axis and an X axis. The graph is
    > > > displaying data read at a number of different dates over a date range.

    The
    > > x
    > > > axis is displaying the dates.
    > > >
    > > > The problem I am having is that the date format is always MM/DD/YYYY
    > > > regardless of how the NumberFormat is set i.e. dates are always in US

    > > format.
    > > > I have noticed that if I set the enumeration to either auto or manual

    the
    > > > dates show in the correct format but the graph it wrong. If I set it

    to
    > > > NumberFormatEnum.None then the graph is correct but the date format is

    > > wrong.
    > > >
    > > > Does anyone know what I am doing wrong or is there a bug in setting

    the
    > > > NumberFormat?
    > > >
    > > > Ian H
    > > >

    >




Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1