PRB: Office Chart Component May Not Automatically Apply a Timescale (286319)



The information in this article applies to:

  • Microsoft Office 2003 Web Components
  • Microsoft Office XP Web Components

This article was previously published under Q286319

SYMPTOMS

The Office Chart component does not automatically apply a timescale to your category axis when the category values contain dates.

CAUSE

Before the Office Chart component automatically applies a timescale to a category axis, it examines the values on the category axis to determine if they are dates. The Chart component examines only a subset of the category data; in general, if the first, middle and last category values represent dates, a timescale is applied.

Also, note that the timescale feature is supported only with Column, Bar, Line, Area and Stock charts. Other chart types do not support a timescale for categories.

RESOLUTION

There is no way to force a timescale for category values. If you are using one of the chart types that support a timescale but the timescale is not applied because of non-date category data, use one of the following workarounds:
  • Apply a different sort order to the category data.
  • Use a filter for the category data so that the non-date values are removed before you plot your chart.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In any text editor, create a new HTML file named Timescale.htm, and paste the following code:
    <html>
    <body>
    <object classid="clsid:0002E556-0000-0000-C000-000000000046" id="CSpace">
    </object>
    </body>
    <script language="VBScript">
        Dim c, oChart, oSeries
        CSpace.Clear
        Set oChart = CSpace.Charts.Add
        Set oSeries = oChart.SeriesCollection.Add
        Set c = CSpace.Constants
        oSeries.SetData c.chDimCategories, c.chDataLiteral, _
            Array(" ", "Jan-3", "Jan-6", "Jan-7", " ", "Jan-12", "Jan-13")
        oSeries.SetData c.chDimValues, c.chDataLiteral, _
            Array(100, 200, 150, 200, 350, 450, 200)        
    </script>        
    </html>
    					

    NOTE: In the preceeding code, please change the classid according to the version of Office installed on your computer.
  2. Start Internet Explorer, and browse to Timescale.htm. When the Web page is rendered, a column chart appears with no timescale.

Workaround

  1. In the sample code, change the following line:
        oSeries.SetData c.chDimCategories, c.chDataLiteral, _
            Array(" ", "Jan-3", "Jan-6", "Jan-7", " ", "Jan-12", "Jan-13")
    						
    to:
        oSeries.SetData c.chDimCategories, c.chDataLiteral, _
            Array("Jan-1", "Jan-3", "Jan-6", "Jan-7 ", " ", "Jan-12 ", "Jan-13 ")
    					
  2. In the browser, refresh the Web page. Notice that the column chart now has a timescale.

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

289288 INFO: Using Timescale Axes with the Office XP Chart Component

For more information about Microsoft Office and Office Web Components, see the following Microsoft Web sites:

Microsoft Office Web Components
http://support.microsoft.com/ofd

Microsoft Office Developer Center
http://msdn.microsoft.com/office/


Modification Type:MinorLast Reviewed:8/23/2005
Keywords:kbOfficeWebChart kbprb KB286319