为什么我的ChartSpace用不了?

peterpansh 2005-04-19 11:19:11
我的PC上已经安装了Office2003了,可是 我的test.htm 还是显示:对不起,您的电脑没有安装Microsoft Office系列软件

test.htm
==========
<table width = "100%" height = "100%">
<tr>
<td>
<object id=ChartSpace1 classid=CLSID:0002E500-0000-0000-C000-000000000046 style="width:100%;height:100%">
对不起,您的电脑没有安装Microsoft Office系列软件
</object>
</td>
</tr>

</table>

为什么?
...全文
118 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenjinaban 2005-04-29
  • 打赏
  • 举报
回复
下载必要的组件
如何安装mschart#Region "定义变量" Const XOffset As Integer = 50, Yoffset As Integer = 20 Dim WithEvents PicCurve As PictureBox Dim xStep As Single = 5, yStep As Single Dim ValueArray As ArrayList Dim ThresHold() As Single 'HIHI、HI、LO、LOLO Dim Name As String = "参数名" Dim Unit As String = "单位" #End Region #Region "构造函数、析构函数" Public Sub New(ByVal mPictureBox As PictureBox, ByVal mThresHold() As Single, ByVal mName As String) ValueArray = New ArrayList PicCurve = mPictureBox ThresHold = mThresHold mPictureBox.BorderStyle = BorderStyle.None Name = mName End Sub Protected Overrides Sub Finalize() MyBase.Finalize() ValueArray.Clear() End Sub #End Region #Region "添加要绘制的点的信息" Public Sub AddValue(ByVal Value As Single) 'Value = ThresHold(0) * Rnd() + ThresHold(3) '测试代码 ValueArray.Add(Value) Call DrawCurve(GetGraphics(PicCurve)) End Sub Public Sub AddValues(ByVal Values() As Single, ByVal G As Graphics) For i As Integer = 0 To Values.Length - 1 ValueArray.Add(Values(i)) Next Call DrawCurve(G) End Sub #End Region #Region "绘制点之间的连线" Private Sub DrawCurve(ByVal G As Graphics, Optional ByVal mClear As Boolean = True) If ValueArray.Count > 0 Then If mClear Then G.Clear(Color.White) G.SmoothingMode = Drawing2D.SmoothingMode.HighQuality Dim mPoints(ValueArray.Count - 1) As Point, Position As Integer = XOffset For i As Integer = ValueArray.Count - 1 To 0 Step -1 Dim ThisValue As Single = CType(ValueArray(i), Single) 'If Position < PicCurve.Width Then Position += xStep Else Exit For Position += xStep mPoints(i) = New Point(Position, (ThresHold(0) - ThisValue) * yStep + Yoffset) Next G.DrawCurve(Pens.Blue, mPoints) mPoints = Nothing End If End Sub #End Region #Region "绘制坐标系统" Private Sub DrawReferenceFrame(ByVal G As Graphics) Dim mPoint1 As New Point, mPoint2 As New Point '定义绘图画笔 Dim MyPen As New Pen(Color.Black, 3) Dim MyStringFormat As New System.Drawing.StringFormat MyStringFormat.Alignment = StringAlignment.Center Dim mSize As New SizeF MyPen.SetLineCap(Drawing2D.LineCap.NoAnchor, Drawing2D.LineCap.ArrowAnchor, Drawing2D.DashCap.Flat) Dim mFont As Font = New Font(FontFamily.GenericSansSerif, 12.0F, FontStyle.Bold) '绘制Y轴 MyPen.Color = Color.Black mPoint1 = New Point(XOffset, PicCurve.Height) mPoint2 = New Point(XOffset, 0) G.DrawLine(MyPen, mPoint1, mPoint2) '绘制X轴 MyPen.Color = Color.LightGreen mPoint1 = New Point(XOffset, PicCurve.Height / 2) mPoint2 = New Point(PicCurve.Width, PicCurve.Height / 2) G.DrawLine(MyPen, mPoint1, mPoint2) '绘制参数名 MyStringFormat.FormatFlags = StringFormatFlags.DirectionVertical mSize = G.MeasureString(Name, mFont) mPoint1.Offset(-mSize.Height, 0) G.DrawString(Name, mFont, Brushes.Black, mPoint1, MyStringFormat) '绘制参数各门限 MyPen.DashStyle = Drawing2D.DashStyle.Dash : MyPen.Width = 2 MyPen.SetLineCap(Drawing2D.LineCap.NoAnchor, Drawing2D.LineCap.NoAnchor, Drawing2D.DashCap.Round) 'HI If ThresHold(1) <> ThresHold(0) Then MyPen.Color = Color.Yellow mPoint1 = New Point(XOffset, (ThresHold(0) - ThresHold(1)) * yStep + Yoffset) mPoint2 = New Point(PicCurve.Width, (ThresHold(0) - ThresHold(1)) * yStep + Yoffset) G.DrawLine(MyPen, mPoint1, mPoint2) mSize = G.MeasureString(ThresHold(1).ToString, mFont) mPoint1.Offset(-mSize.Width, -mSize.Height / 2) G.DrawString(ThresHold(1).ToString, mFont, Brushes.Yellow, mPoint1) End If 'LO If ThresHold(2) <> ThresHold(3) Then mPoint1 = New Point(XOffset, (ThresHold(0) - ThresHold(2)) * yStep + Yoffset) mPoint2 = New Point(PicCurve.Width, (ThresHold(0) - ThresHold(2)) * yStep + Yoffset) G.DrawLine(MyPen, mPoint1, mPoint2) mSize = G.MeasureString(ThresHold(2).ToString, mFont) mPoint1.Offset(-mSize.Width, -mSize.Height / 2) G.DrawString(ThresHold(2).ToString, mFont, Brushes.Yellow, mPoint1) End If 'HIHI MyPen.Color = Color.Red mPoint1 = New Point(XOffset, Yoffset) mPoint2 = New Point(PicCurve.Width, Yoffset) G.DrawLine(MyPen, mPoint1, mPoint2) mSize = G.MeasureString(ThresHold(0).ToString, mFont) mPoint1.Offset(-mSize.Width, -mSize.Height / 2) G.DrawString(ThresHold(0).ToString, mFont, Brushes.Red, mPoint1) 'LOLO mPoint1 = New Point(XOffset, PicCurve.Height - Yoffset) mPoint2 = New Point(PicCurve.Width, PicCurve.Height - Yoffset) G.DrawLine(MyPen, mPoint1, mPoint2) mSize = G.MeasureString(ThresHold(3).ToString, mFont) mPoint1.Offset(-mSize.Width, -mSize.Height / 2) G.DrawString(ThresHold(3).ToString, mFont, Brushes.Red, mPoint1) MyPen.Dispose() mFont.Dispose() End Sub #End Region #Region "要在其上绘制的控件事件" Private Sub PicCurve_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicCurve.Paint Call DrawReferenceFrame(e.Graphics) End Sub Private Sub PicCurve_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles PicCurve.Resize On Error Resume Next xStep = 5 yStep = (PicCurve.Height - 2 * Yoffset) / (ThresHold(0) - ThresHold(3)) End Sub #End Region #Region "绘制永久图像" Function GetGraphics(ByRef pic As PictureBox) As Graphics Dim bmp As Bitmap = New Bitmap(pic.Width, pic.Height) pic.Image = bmp Dim g As System.Drawing.Graphics = Graphics.FromImage(bmp) Return g End Function #End Region #Region "保存图形" Public Sub SaveCurve(ByVal FileName As String) Dim bmp As New Bitmap(PicCurve.Width, PicCurve.Height) Dim g As Graphics = Graphics.FromImage(bmp) Call DrawReferenceFrame(g) Call DrawCurve(g, False) bmp.Save(FileName) End Sub #End Region End Class
OLE 程序标识符请参阅特性 可使用 OLE 程序标识符(有时称作 ProgID)创建自动化对象。下表列出了 ActiveX 控件、Microsoft Office 应用程序和 Microsoft Office Web 组件的 OLE 程序标识符。 ActiveX 控件 Microsoft Access Microsoft Excel Microsoft Graph Microsoft Office Web 组件 Microsoft Outlook Microsoft PowerPoint Microsoft Word ActiveX 控件若要创建下表列出的 ActiveX 控件,请使用相应的 OLE 程序标识符。 若要创建此控件 请使用此标识符 CheckBox Forms.CheckBox ComboBox Forms.ComboBox CommandButton Forms.CommandButton Frame Forms.Frame Image Forms.Image Label Forms.Label ListBox Forms.ListBox MultiPage Forms.MultiPage OptionButton Forms.OptionButton ScrollBar Forms.ScrollBar SpinButton Forms.SpinButton TabStrip Forms.TabStrip TextBox Forms.TextBox ToggleButton Forms.ToggleButton Microsoft Access 若要创建下表列出的 Microsoft Access 对象,请使用相应的 OLE 程序标识符之一。如果使用不带版本号后缀的标识符,则会在最近版本的 Access(运行宏的计算机上可用的 Access 版本)中创建对象。 若要创建此对象 请使用这些标识符之一 Application Access.Application CurrentData Access.CodeData CurrentProject Access.CodeProject DefaultWebOptions Access.DefaultWebOptions Microsoft Excel 若要创建下表列出的 Microsoft Excel 对象,请使用相应的 OLE 程序标识符之一。如果使用不带版本号后缀的标识符,则会在最近版本的 Excel(运行宏的计算机上可用的 Excel 版本)中创建对象。 若要创建此对象 请使用这些标识符之一 备注 Application Excel.Application Workbook Excel.AddIn Workbook Excel.Chart 返回包含两张工作表的工作簿;其中一个为图表,另一个为图表的数据。图表工作表为活动工作表。 Workbook Excel.Sheet 返回具有一张工作表的工作簿。 Microsoft Graph 若要创建下表列出的 Microsoft Graph 对象,请使用相应的 OLE 程序标识符之一。如果使用不带版本号后缀的标识符,则会在最近版本的 Graph(运行宏的计算机上可用的 Graph 版本)中创建对象。 若要创建此对象 请使用这些标识符之一 Application MSGraph.Application Chart MSGraph.Chart Microsoft Office Web 组件若要创建下表列出的 Microsoft Office Web 组件对象,请使用相应的 OLE 程序标识符之一。如果使用不带版本号后缀的标识符,则会在最近版本的 Microsoft Office Web 组件(运行宏的计算机上可用的 Microsoft Office Web 组件版本)中创建对象。 若要创建此对象 请使用这些标识符之一 ChartSpace OWC.Chart DataSourceControl OWC.DataSourceControl ExpandControl OWC.ExpandControl PivotTable OWC.PivotTable RecordNavigationControl OWC.RecordNavigationControl Spreadsheet OWC.Spreadsheet Microsoft Outlook 若要创建下表列出的 Microsoft Outlook 对象,请使用相应的 OLE 程序标识符之一。如果使用不含版本号后缀的标识符,则会在可用的最近版本的 Outlook(运行该宏的计算机上的可用 Outlook 版本)中创建对象。 若要创建此对象 请使用这些标识符之一 Application Outlook.Application Microsoft PowerPoint 若要创建下表列出的 Microsoft PowerPoint 对象,请使用相应的 OLE 程序标识符之一。如果使用不含版本号后缀的标识符,则会在可用的最近版本的 PowerPoint(运行该宏的计算机上的可用 PowerPoint 版本)中创建对象。 若要创建此对象 请使用这些标识符之一 Application PowerPoint.Application Microsoft Word 若要创建下表列出的 Microsoft Word 对象,请使用相应的 OLE 程序标识符之一。如果使用不带版本号后缀的标识符,则会在最近版本的 Word(运行宏的计算机上可用的 Word 版本)中创建对象。 若要创建此对象 请使用这些标识符之一 Application Word.Application Document Word.Document, Word.Template Global Word.Global

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧