CHART Output Format Configuration Scripts

Log Parser

CHART Output Format Configuration Scripts

Charts created by the CHART output format can be customized by user-provided scripts in the JScript or VBScript languages that are executed by the CHART output format prior to generating the output image file.

These scripts can refer to two global objects which expose methods and properties that can be used to modify parameters such as the chart colors, the chart fonts, and many other attributes.
The two global objects available to configuration scripts are instances of the chartSpace and chart objects of the Microsoft Office Web Components ChartSpace object model, and they are named "chartSpace" and "chart", respectively.
For information on the Office Web Components ChartSpace object model, and on the chartSpace and chart objects, visit the MSDN ChartSpace Object Model documentation.

The following example script in the JScript language manipulates the chartSpace and chart objects to add a caption to the chart and to set the background color to the transparent color:

// Add a caption
chartSpace.HasChartSpaceTitle = true;
chartSpace.ChartSpaceTitle.Caption = "Generated by Log Parser 2.2";
chartSpace.ChartSpaceTitle.Font.Size = 6;
chartSpace.ChartSpaceTitle.Position = chartSpace.Constants.chTitlePositionBottom;

// Change the background color
chart.PlotArea.Interior.Color = chartSpace.Constants.chColorNone;
Configuration scripts are used with the CHART output format by specifying their path as a value to the config parameter, as shown in the following example:
LogParser "SELECT SourceName, COUNT(*) AS [Number of Events] INTO Events.gif FROM System GROUP BY SourceName ORDER BY [Number of Events] DESC" -o:CHART -chartType:Column3D -config:MyScript.js
The resulting chart will look like the following example:

Events Chart


© 2004 Microsoft Corporation. All rights reserved.