Chart and Graph 柱状图

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_15267341/article/details/99676327
  zhuZhuangTu.DataSource.SetValue("Category 1", "Group 1", bb.val[0]);
        zhuZhuangTu.DataSource.SetValue("Category 2", "Group 1", bb.val[1]);
        zhuZhuangTu.DataSource.SetValue("Category 3", "Group 1", bb.val[2]);

FR:徐海涛(hunk Xu)
QQ技术交流群:386476712

展开阅读全文

ms Graph Chart 控制

03-21

引用 ms graph 9.0 objectrn代码如下rnOn Error GoTo Err_Normalrn Dim i As Integerrn Dim lRow As Longrn OLE1.Format = "CF_TEXT" ' 置文件格式为文本方式。rn OLE1.SizeMode = 1rn OLE1.CreateEmbed "", "MSGRAPH" '建立内嵌对象rn OLE1.AutoActivate = 0 '关闭编辑rn OLE1.AutoVerbMenu = Falsern Dim oGraphChart As Graph.Chartrn Set oGraphChart = OLE1.objectrn oGraphChart.ChartType = xl3DAreaStacked 'xl3DArearn' OLE1.object.ChartType = -4098 'xl3DAreaStackedrn' OLE1.OLETypern Dim Msg, NL, TB ' 变量声明。rn Dim sMCaption As String '头rn Dim smsgArray() As String '列数据rn rn Dim sTmp As Stringrn TB = Chr(9) ' Tab 字符。rn NL = Chr(10) ' 换行字符。rn If arec.State = 0 Then Exit Functionrn If arec.RecordCount <= 0 Then Exit Functionrn ReDim smsgArray(arec.Fields.Count - 1)rn For i = 0 To arec.Fields.Count - 1rn smsgArray(i) = NL & arec.Fields(i).Namern Next irn lRow = 0rn While Not arec.EOFrn sMCaption = sMCaption & TB & arec.Fields(0).Valuern For i = 0 To arec.Fields.Count - 1rn smsgArray(i) = smsgArray(i) & TB & arec.Fields(i)rn Next irn arec.MoveNextrn Wendrn rn For i = 0 To UBound(smsgArray)rn' If smsgArray(i) <> "" Thenrn' smsgArray(i) = Mid(smsgArray(i), 1, Len(smsgArray(i)) - 1)rn' End Ifrn Msg = Msg & smsgArray(i)rn Next irn Msg = sMCaption & Msgrn Debug.Print Msgrn OLE1.DoVerb -3rn If OLE1.AppIsRunning Thenrn OLE1.DataText = Msgrn ' 更新该对象。rn OLE1.Updatern Elsern MsgBox "Graph isn't active."rn End Ifrnrn注意到这个xl3DAreaStacked 了吧,9.0里定义的,怎么把它们全都找出来?rn我不想引用这个9.0动态库 论坛

没有更多推荐了,返回首页