(加急)请教:如何用Microsoft Office Web Components创这种有挑战性的曲线图?

littlecpu 2003-07-27 10:07:52
这种有挑战性的典线图吗,说来话短!!
举个曲线图的例子,横坐标为年份,纵坐标为万元(企业GDP)

1000|
800|
600|
400|
200|
产值(万元) 0|____________________________________________
1999 2000 2001 2002 20003
年份

但现在客户的需求有点怪怪的,需要再加入相应企业当年(1999、2000、2001、2002、2003等)的利润,计量单位却他妈的是元(是元,不是万元),还要求这两种量同时出现在Chart中,客户提供了一个样图是这样的

1000| | 8000000
800| | 6000000
600| | 4000000
400| | 2000000
200| | 1000000
产值(万元) 0|________________________________|_ 0 利润(元)
1999 2000 2001 2002 20003
年份

利润刻度不一定要放在右边,放在左边也行。

简单点说,这个问题是:如何画有两种计量单位的曲线图

利润刻度不一定要放在右边,放在左边也行。
...全文
46 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
webdiyer 2003-08-03
  • 打赏
  • 举报
回复
为什么不用DundasChart啊,很简单的。
littlecpu 2003-08-03
  • 打赏
  • 举报
回复
net_lover(孟子E章),你推荐的文章很实用,谢谢
但,我的问题集中在OWC.Chart组件是否以在Y轴上有两种单位,及如何实现的问题。哎,我实在是翻不出这种变态例子。(owc的随机帮助我都翻烂了,这几天正在和客户磨更改需求,不要有这种变态要求,不标准)
shenlongju 2003-08-03
  • 打赏
  • 举报
回复
up
孟子E章 2003-08-03
  • 打赏
  • 举报
回复
http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=ADB6D011-A4AD-43A0-A8BF-3CED872A7A95
樟树林的世界 2003-08-03
  • 打赏
  • 举报
回复
up
littlecpumj1 2003-07-28
  • 打赏
  • 举报
回复
up
littlecpu 2003-07-27
  • 打赏
  • 举报
回复
这是OWC控件的一个例子(用数组作数据源,保存为htm即可查看结果)
装Office2000即有OWC,这是官方下载地址
http://office.microsoft.com/downloads/2002/owc10.aspx

<object id=ChartSpace1 classid=CLSID:0002E556-0000-0000-C000-000000000046 style="width:100%;height:350"></object>

<script language=vbs>
Sub Window_OnLoad()

Dim categories(3)
Dim values(3)
Dim chConstants

' Create an array of strings representing the categories.
' The categories will be the same for all three series.
categories(0) = "Car"
categories(1) = "Sport-Utility"
categories(2) = "Truck"
categories(3) = "Minivan"

' Clear the contents of the chart workspace. This removes
' any old charts that may already exist and leaves the chart workspace
' completely empty. One chart object is then added.
ChartSpace1.Clear
ChartSpace1.Charts.Add
Set chConstants = ChartSpace1.Constants

' Add three series to the chart.
ChartSpace1.Charts(0).SeriesCollection.Add
ChartSpace1.Charts(0).SeriesCollection.Add
ChartSpace1.Charts(0).SeriesCollection.Add

' Series one contains sales growth data for 1998.
' Set the series caption (the text that appears in the legend).
ChartSpace1.Charts(0).SeriesCollection(0).Caption = "1998"

' Set the categories for the first series (this collection is zero-based)
ChartSpace1.Charts(0).SeriesCollection(0).SetData chConstants.chDimCategories, chConstants.chDataLiteral, categories

values(0) = 0.2
values(1) = 0.06
values(2) = 0.17
values(3) = 0.13

ChartSpace1.Charts(0).SeriesCollection(0).Caption = "1998"
ChartSpace1.Charts(0).SeriesCollection(0).SetData chConstants.chDimCategories, chConstants.chDataLiteral, categories
ChartSpace1.Charts(0).SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataLiteral, values

' Series two contains sales growth data for 1999.
' Update the values array, then set the chart data.
values(0) = 0.38
values(1) = 0.82
values(2) = 0.28
values(3) = 0.62

ChartSpace1.Charts(0).SeriesCollection(1).Caption = "1999"
ChartSpace1.Charts(0).SeriesCollection(1).SetData chConstants.chDimCategories, chConstants.chDataLiteral, categories
ChartSpace1.Charts(0).SeriesCollection(1).SetData chConstants.chDimValues, chConstants.chDataLiteral, values

' Series two contains sales growth data for 2000.
' Update the values array, and then set the chart data.
values(0) = 0.42
values(1) = 0.12
values(2) = 0.55
values(3) = 0.25

ChartSpace1.Charts(0).SeriesCollection(2).Caption = "2000"
ChartSpace1.Charts(0).SeriesCollection(2).SetData chConstants.chDimCategories, chConstants.chDataLiteral, categories
ChartSpace1.Charts(0).SeriesCollection(2).SetData chConstants.chDimValues, chConstants.chDataLiteral, values

' Make the chart legend visible, format the left value axis as percentage,
' and specify that value gridlines are at 10% intervals.
ChartSpace1.Charts(0).HasLegend = True
ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionLeft).NumberFormat = "0%"
ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionLeft).MajorUnit = 0.1
End Sub
</script>

littlecpu 2003-07-27
  • 打赏
  • 举报
回复
s
      1000|
       800|
       600|
       400|
       200|
产值(万元) 0|____________________________________________
       1999 2000 2001 2002 20003
       年份


      1000| | 8000000
       800| | 6000000
       600| | 4000000
       400| | 2000000
       200| | 1000000
产值(万元) 0|________________________________|_ 0 利润(元)
1999 2000 2001 2002 20003
年份
littlecpu 2003-07-27
  • 打赏
  • 举报
回复
1000|
       800|
       600|
       400|
       200|
产值(万元) 0|____________________________________________
       1999 2000 2001 2002 20003
       年份


      1000| | 8000000
       800| | 6000000
       600| | 4000000
       400| | 2000000
       200| | 1000000
产值(万元) 0|________________________________|_ 0 利润(元)
1999 2000 2001 2002 20003
年份

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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