OWC11 Timescale date formatting

K

Ken Wilson

I keep attempting to change the date format on an axis useing .NumberFormat =
and nothing appears to change at all, despite numerous format considerations
and changes to the code.

How does one format the label for X-Axis when dealing with timscale
axis. My dates appear fine but need thme to display in the format
"APR-04" , Month-Year.

This is possible in Excel using codes with the majorunitscale property
and setting it to xlmonths.

OWC11 should have some sort of equivalent capability.

Thanks for the help
 
A

Alvin Bruney [MVP]

you should set the format string to ddd-yy
you may have to play around with it but i think that mask will give you what
you are after
 
K

Ken Wilson

Does not work.

my code

axis.NumberFormat = "mmm-yy"

"mmm-yy" should be the proper format string
I tried ddd-yy and got nothing

When its a timescale axis it appears to be ignoring any attempt
to use the number format property. There is a way to turn off the
the the automatic recognition of a timescale, but that seems to
have no affect either

This is supposed to turn off the automatic grouping, from what I
have read.

axis.GroupingType = c.chAxisGroupingNone

Something may be out of sequence for this to work but there is no
example in Microsoft's stuff of actually using a Timescale.

Don't know how they can make it work in Excel and not in OWC
It appears the development teams don't talk to each other.



Alvin Bruney said:
you should set the format string to ddd-yy
you may have to play around with it but i think that mask will give you what
you are after

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
I keep attempting to change the date format on an axis useing .NumberFormat
=
and nothing appears to change at all, despite numerous format
considerations
and changes to the code.

How does one format the label for X-Axis when dealing with timscale
axis. My dates appear fine but need thme to display in the format
"APR-04" , Month-Year.

This is possible in Excel using codes with the majorunitscale property
and setting it to xlmonths.

OWC11 should have some sort of equivalent capability.

Thanks for the help
 
A

Alvin Bruney [MVP]

were you able to figure this out or do you still need help on it

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
Does not work.

my code

axis.NumberFormat = "mmm-yy"

"mmm-yy" should be the proper format string
I tried ddd-yy and got nothing

When its a timescale axis it appears to be ignoring any attempt
to use the number format property. There is a way to turn off the
the the automatic recognition of a timescale, but that seems to
have no affect either

This is supposed to turn off the automatic grouping, from what I
have read.

axis.GroupingType = c.chAxisGroupingNone

Something may be out of sequence for this to work but there is no
example in Microsoft's stuff of actually using a Timescale.

Don't know how they can make it work in Excel and not in OWC
It appears the development teams don't talk to each other.



Alvin Bruney said:
you should set the format string to ddd-yy
you may have to play around with it but i think that mask will give you
what
you are after

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
I keep attempting to change the date format on an axis useing
.NumberFormat
=
and nothing appears to change at all, despite numerous format
considerations
and changes to the code.

How does one format the label for X-Axis when dealing with timscale
axis. My dates appear fine but need thme to display in the format
"APR-04" , Month-Year.

This is possible in Excel using codes with the majorunitscale property
and setting it to xlmonths.

OWC11 should have some sort of equivalent capability.

Thanks for the help
 
K

Ken Wilson

Have not figured it out yet, still stumped.

Read several other posts that indicate that TimeScales
reference the local regional settings for dates.

But no solution to format the date.
Another post I read referenced the type of chart being a
problem.

all the "Examples" I have seen appear to be using an Excel
Worksheet as the data source and then apply formatting at the
worksheet level.




Alvin Bruney said:
were you able to figure this out or do you still need help on it

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
Does not work.

my code

axis.NumberFormat = "mmm-yy"

"mmm-yy" should be the proper format string
I tried ddd-yy and got nothing

When its a timescale axis it appears to be ignoring any attempt
to use the number format property. There is a way to turn off the
the the automatic recognition of a timescale, but that seems to
have no affect either

This is supposed to turn off the automatic grouping, from what I
have read.

axis.GroupingType = c.chAxisGroupingNone

Something may be out of sequence for this to work but there is no
example in Microsoft's stuff of actually using a Timescale.

Don't know how they can make it work in Excel and not in OWC
It appears the development teams don't talk to each other.



Alvin Bruney said:
you should set the format string to ddd-yy
you may have to play around with it but i think that mask will give you
what
you are after

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I keep attempting to change the date format on an axis useing
.NumberFormat
=
and nothing appears to change at all, despite numerous format
considerations
and changes to the code.

How does one format the label for X-Axis when dealing with timscale
axis. My dates appear fine but need thme to display in the format
"APR-04" , Month-Year.

This is possible in Excel using codes with the majorunitscale property
and setting it to xlmonths.

OWC11 should have some sort of equivalent capability.

Thanks for the help
 
A

Alvin Bruney [MVP]

ok, give me a second or two to work this out. as i understand it when
timescaling is applied, numberformats don't work right?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
Have not figured it out yet, still stumped.

Read several other posts that indicate that TimeScales
reference the local regional settings for dates.

But no solution to format the date.
Another post I read referenced the type of chart being a
problem.

all the "Examples" I have seen appear to be using an Excel
Worksheet as the data source and then apply formatting at the
worksheet level.




Alvin Bruney said:
were you able to figure this out or do you still need help on it

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
Does not work.

my code

axis.NumberFormat = "mmm-yy"

"mmm-yy" should be the proper format string
I tried ddd-yy and got nothing

When its a timescale axis it appears to be ignoring any attempt
to use the number format property. There is a way to turn off the
the the automatic recognition of a timescale, but that seems to
have no affect either

This is supposed to turn off the automatic grouping, from what I
have read.

axis.GroupingType = c.chAxisGroupingNone

Something may be out of sequence for this to work but there is no
example in Microsoft's stuff of actually using a Timescale.

Don't know how they can make it work in Excel and not in OWC
It appears the development teams don't talk to each other.



"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
you should set the format string to ddd-yy
you may have to play around with it but i think that mask will give
you
what
you are after

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I keep attempting to change the date format on an axis useing
.NumberFormat
=
and nothing appears to change at all, despite numerous format
considerations
and changes to the code.

How does one format the label for X-Axis when dealing with timscale
axis. My dates appear fine but need thme to display in the format
"APR-04" , Month-Year.

This is possible in Excel using codes with the majorunitscale
property
and setting it to xlmonths.

OWC11 should have some sort of equivalent capability.

Thanks for the help
 
A

Alvin Bruney [MVP]

modify your code to the following
objChart.Axes[0].NumberFormat = "MM-yyyy";
//"[RED]#,##0_);(#,##0)";


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin Bruney said:
ok, give me a second or two to work this out. as i understand it when
timescaling is applied, numberformats don't work right?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Ken Wilson said:
Have not figured it out yet, still stumped.

Read several other posts that indicate that TimeScales
reference the local regional settings for dates.

But no solution to format the date.
Another post I read referenced the type of chart being a
problem.

all the "Examples" I have seen appear to be using an Excel
Worksheet as the data source and then apply formatting at the
worksheet level.




Alvin Bruney said:
were you able to figure this out or do you still need help on it

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Does not work.

my code

axis.NumberFormat = "mmm-yy"

"mmm-yy" should be the proper format string
I tried ddd-yy and got nothing

When its a timescale axis it appears to be ignoring any attempt
to use the number format property. There is a way to turn off the
the the automatic recognition of a timescale, but that seems to
have no affect either

This is supposed to turn off the automatic grouping, from what I
have read.

axis.GroupingType = c.chAxisGroupingNone

Something may be out of sequence for this to work but there is no
example in Microsoft's stuff of actually using a Timescale.

Don't know how they can make it work in Excel and not in OWC
It appears the development teams don't talk to each other.



"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
you should set the format string to ddd-yy
you may have to play around with it but i think that mask will give
you
what
you are after

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I keep attempting to change the date format on an axis useing
.NumberFormat
=
and nothing appears to change at all, despite numerous format
considerations
and changes to the code.

How does one format the label for X-Axis when dealing with timscale
axis. My dates appear fine but need thme to display in the format
"APR-04" , Month-Year.

This is possible in Excel using codes with the majorunitscale
property
and setting it to xlmonths.

OWC11 should have some sort of equivalent capability.

Thanks for the help
 
K

Ken Wilson

ok, give me a second or two to work this out. as i understand it when
timescaling is applied, numberformats don't work right?


Correct,
making line graph with markers, data is be pulled using ADO to
a sql server.

objRS.Open SQL1
set objChartSpace.DataSource = objRS
set c = objChartSpace.Constants

objChartSpace.DisplayFieldButtons = False
set objChart = objChartSpace.Charts(0)

objChart.PlotArea.Interior.Color = "tan"
objChart.HasLegend = True
objChart.Legend.Position = c.chLegendPositionBottom
objChart.Legend.Font.Name = "Arial"
objChart.Legend.Font.Size = strLegendFont
objChart.HasTitle = True
objChart.Title.Font.Name = "Verdana"
objChart.Title.Font.Size = strFont
objChart.Legend.Font.Bold = True
objChart.Title.Font.Bold = True

objChartSpace.SetData c.chDimSeriesNames, c.chDataBound, "Type"
objChartSpace.SetData c.chDimCategories, c.chDataBound, "Date"
objChartSpace.SetData c.chDimValues, c.chDataBound, "Amount"

' Category (X) axis.
With objchart.Axes(c.chAxisPositionTimescale).MajorUnit = 1
.MinorUnit = 1

End With

objChart.Type = c.chChartTypeLineMarkers



This always returns an error of "Invalid Parameter" and have tried
several formatting strings of which none work.

if I debug.print the number format it always returns "Short Date"
 
K

Ken Wilson

modify your code to the following
objChart.Axes[0].NumberFormat = "MM-yyyy";
//"[RED]#,##0_);(#,##0)";

Still fails, your code looks like C# or C
Vbscript may not work in this case
 
E

endernaught

While you probably have figured this out by now... I found a way that worked
for me (OWC 10, VBA)... My chart is bound to a PivotTable however. Hope this
helps someone.

To set the date format of a category field, I dove into the category's
PivotAxis object:

chtChart.Axes(0).CategoryLabels.PivotAxis.Fields(0).NumberFormat = "mmmm-yy"
' PivotAxis.Fields(0) because the date field was the first to be added

Cheers,
Brad

Ken Wilson said:
modify your code to the following
objChart.Axes[0].NumberFormat = "MM-yyyy";
//"[RED]#,##0_);(#,##0)";

Still fails, your code looks like C# or C
Vbscript may not work in this case
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top