找回密码
 立即注册

QQ登录

只需一步,快速开始

tianyake

注册会员

23

主题

58

帖子

183

积分

注册会员

积分
183

活字格认证

tianyake
注册会员   /  发表于:2013-10-28 11:33  /   查看:5383  /  回复:5
如题,见下图:

QQ图片20131028113207.jpg

163.8 KB, 下载次数: 418

5 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-10-28 14:23:00
沙发
回复 1楼tianyake的帖子

tianyake 你好,
实现图中功能需要使用自己画,可以参考帮助文档:
To create an owner-drawn cell  章节。

随机安装 Demo :C:\Program Files (x86)\FarPoint Technologies\Spread 8\Samples\ActiveX\VB6\Overview
回复 使用道具 举报
tianyake
注册会员   /  发表于:2013-10-28 16:44:00
板凳
7.0里面可以做吗
我看到7.0里的Samples\ActiveX\VB6\Overview没有图表的例子
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-10-28 18:03:00
地板
回复 3楼tianyake的帖子

不是图表的例子,是General 下的一个例子,如图:

Untitled.png


Spread COM 7.0 我没有安装,不知道你在帮助文档中是否搜索到了 To create an owner-drawn cell  相关章节?如果有就可以进行自定义绘制。
回复 使用道具 举报
tianyake
注册会员   /  发表于:2013-10-28 23:29:00
5#
7.0下也有这个,也能够搜索到To create an owner-drawn cell ,里面有很多celltype,不知道应该用哪种?
能否帮我弄两个数据,做两个上图的柱状图和线图
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-10-29 08:57:00
6#
回复 5楼tianyake的帖子

不好意思,Spread COM版不支持图表功能,Spread 其他平台产品都提供丰富图表功能。
VB6.0 绘图方法我也不太了解,在 Spread 使用方面,起作用的是这个事件:

  1. Private Sub spread_DrawItem(ByVal Col As Long, ByVal row As Long, ByVal hDC As stdole.OLE_HANDLE, ByVal left As Long, ByVal top As Long, ByVal right As Long, ByVal Bottom As Long, ByVal style As Long)
  2.   Dim s As Long
  3.   Dim hBrush As Long
  4.   Dim Rec As RECT
  5.   Dim xMargin As Long
  6.   Dim yMargin As Long
  7.   
  8.   ' Reduce the cell rectangle by 10 percent on each side.
  9.   Rec.left = left / Screen.TwipsPerPixelX
  10.   Rec.right = right / Screen.TwipsPerPixelX
  11.   Rec.top = top / Screen.TwipsPerPixelY
  12.   Rec.Bottom = Bottom / Screen.TwipsPerPixelY

  13.   ' Reduce the rectangle by 20 percent.
  14.   xMargin = (Rec.right - Rec.left) / 10
  15.   yMargin = (Rec.Bottom - Rec.top) / 10
  16.   Rec.left = Rec.left + xMargin
  17.   Rec.right = Rec.right - xMargin
  18.   Rec.top = Rec.top + yMargin
  19.   Rec.Bottom = Rec.Bottom - yMargin

  20.   ' Use Style parameter (.i.e TypeOwnerDrawStyle property of cell) to
  21.   ' determine the figure to paint in the cell.
  22.   If style = STYLE_ELLIPSE Then
  23.     s = Ellipse(hDC, Rec.left, Rec.top, Rec.right, Rec.Bottom)
  24.   ElseIf style = STYLE_RECTANGLE Then
  25.     s = Rectangle(hDC, Rec.left, Rec.top, Rec.right, Rec.Bottom)
  26.   ElseIf style = STYLE_ROUNDRECT Then
  27.     s = RoundRect(hDC, Rec.left, Rec.top, Rec.right, Rec.Bottom, (Rec.left - Rec.right) / 3, (Rec.Bottom - Rec.top) / 3)
  28.   ElseIf style = STYLE_FILLRECT Then
  29.     hBrush = CreateSolidBrush(RGB(255, 0, 0))
  30.     s = FillRect(hDC, Rec, hBrush)
  31.     s = DeleteObject(hBrush)
  32.   End If
  33.   
  34.   ' Also use the Text property of cell
  35.   spread.Col = Col
  36.   spread.row = row
  37.   s = DrawText(hDC, spread.Text, Len(spread.Text), Rec, DT_CENTER + DT_VCENTER + DT_SINGLELINE)

  38. End Sub
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部