OWC画图时出现内存不足的问题!异常详细信息: System.OutOfMemoryException: 内存不足。

loulanlouzhu 2004-03-14 10:45:44
源错误:


行 110: Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimSeriesNames, Convert.ToInt16(OWC.ChartSpecialDataSourcesEnum.chDataLiteral), "Series1");
行 111: // '将数组中的数据植入图表
行 112: Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimXValues, Convert.ToInt16(OWC.ChartSpecialDataSourcesEnum.chDataLiteral),aX);
行 113: Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimYValues, Convert.ToInt16(OWC.ChartSpecialDataSourcesEnum.chDataLiteral), aY);
行 114: //'设置绘图空间格式


源文件: c:\inetpub\wwwroot\datagridtoexcel\getchart.aspx.cs 行: 112

堆栈跟踪:


[OutOfMemoryException: 内存不足。]
OWC.WCSeries.SetData(ChartDimensionsEnum Dimension, Int32 DataSourceIndex, Object DataReference) +0
DataGridToExcel.getchart.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\datagridtoexcel\getchart.aspx.cs:112
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


...全文
294 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wudixiaocaoren 2004-03-15
  • 打赏
  • 举报
回复
http://www.uncj.net/bbs/dispbbs.asp?boardID=10&replyID=77468&ID=12495&skin=1
houjianxun 2004-03-15
  • 打赏
  • 举报
回复
估计是算法有问题,试试双缓冲画图
loulanlouzhu 2004-03-14
  • 打赏
  • 举报
回复
ds = Class1.GetKJ95Data(DateTime.Parse("2003-9-13"),13201);
int i = 0;
// 'NumPoints = 表示数据库中数据点个数的整数'
int NumPoints = 720;
// 'aX = 存放X值的数组
int[] aX = new int[720];

// 'aY = 存放Y值的数组
double[] aY = new double[720];

// '定义图表对象、数据系列对象,OWC绘图必需


int m = 0;
for(int j = 0;j<ds.Tables[0].Rows.Count;j++)
{

for(int k=0 ;k<ds.Tables[0].Columns.Count;k++)
{
int n = 2*m;
aX[i] = n;
aY[i] = Convert.ToDouble(ds.Tables[0].Rows[j][k]);
m = m+1;
i=i+1;
}

}

//'新建一个绘图空间
OWC.ChartSpaceClass ChartSpace1 = new OWC.ChartSpaceClass();
//'在ChartSpace1绘图空间中新建一个图表
OWC.WCChart Chart1 = ChartSpace1.Charts.Add(0);
// '在Chart1图表中加入一个数据系列
OWC.WCSeries Chart1_Series1 = Chart1.SeriesCollection.Add(0);
//// '将Chart1_Series1数据系列定义成XY散点图,
//'带连线和数据点标记
Chart1_Series1.Type = OWC.ChartChartTypeEnum.chChartTypeScatterLineMarkers;//
//ChartSpace1.Constants.chChartTypeScatterLineMarkers;
// '命名数据系列(名称将在图例中显示出来)
Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimSeriesNames, Convert.ToInt16(OWC.ChartSpecialDataSourcesEnum.chDataLiteral), "Series1");
// '将数组中的数据植入图表
Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimXValues, Convert.ToInt16(OWC.ChartSpecialDataSourcesEnum.chDataLiteral),aX);
Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimYValues, Convert.ToInt16(OWC.ChartSpecialDataSourcesEnum.chDataLiteral), aY);
//'设置绘图空间格式
object Color = "Rosybrown";
object Color1 = "Wheat";
ChartSpace1.Border.set_Color(ref Color);

//'设置图表格式

Chart1.SeriesCollection[0].Interior.set_Color(ref Color);//Color = "Rosybrown";
Chart1.PlotArea.Interior.set_Color(ref Color1);
Chart1.HasLegend = true;
Chart1 .Legend.Position = OWC.ChartLegendPositionEnum.chLegendPositionBottom;
Chart1.HasTitle = true;
Chart1 .Title.Caption = "XY散点图示例";
Chart1 .Axes[0].HasTitle = true;
Chart1 .Axes[0].Title.Caption = "Y轴";
Chart1 .Axes[1].HasTitle = true;
Chart1 .Axes[1].Title.Caption = "X轴";
ChartSpace1.ExportPicture(Server.MapPath(".") + "\\aaaa.gif", "gif", 500, 400);
loulanlouzhu 2004-03-14
  • 打赏
  • 举报
回复
但是查看资源管理器的内存资源还有五六十M呢!
loulanlouzhu 2004-03-14
  • 打赏
  • 举报
回复
// aX = 存放X值的数组
int[] aX = new int[720];

// aY = 存放Y值的数组
double[] aY = new double[720];
loulanlouzhu 2004-03-14
  • 打赏
  • 举报
回复
Retrieving the COM class factory for component with CLSID {0002E55D-0000-0000-C000-000000000046} failed due to the following error: 80040154. 收藏 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {0002E55D-0000-0000-C000-000000000046} failed due to the following error: 80040154. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x80040154): Retrieving the COM class factory for component with CLSID {0002E55D-0000-0000-C000-000000000046} failed due to the following error: 80040154.] GraphPage.Page_Load(Object sender, EventArgs e) +1097 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082 请大家帮忙 谢谢 Server Error in '/' Application. -------------------------------------------------------------------------------- Retrieving the COM class factory for component with CLSID {0002E55D-0000-0000-C000-000000000046} failed due to the following error: 80040154.

62,046

社区成员

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

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

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

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