Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message oups.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" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I force a secondary horizontal axis to act as a date axis? | Charts and Charting in Excel | |||
How to give the numberformat the systemdefault date format? | Excel Programming | |||
how to draw a chart using x,y axis not the date with x-axis? | Excel Worksheet Functions | |||
NumberFormat e date | Excel Programming | |||
Cell Date/Time and NumberFormat issue | Excel Programming |