2013-08-01 24 views
0

改善MSChart工具的性能?提高MSChart工具的性能?

我们在一个ASP.net 3.5 web应用程序上使用MSChart,并注意到启用工具提示时显着的缓慢。绘制图表的表现非常缓慢。由于我使用大型数据集绘制图形,图表输出为JPEG,并且总共包含500多个数据点。

  chart.DataSource = dv; 
      chart.Series.Invalidate(); 
      chart.Series.SuspendUpdates(); 

      chart.Series["Series1"].XValueMember = "Time_Value"; 
      chart.Series["Series1"].YValueMembers = "Total1"; 
      chart.Series["Series2"].XValueMember = "Time_Value"; 
      chart.Series["Series2"].YValueMembers = "Total_thru"; 
      chart.Series["Series3"].XValueMember = "Time_Value"; 
      chart.Series["Series3"].YValueMembers = "Total2"; 
      chart.Series["Series4"].XValueMember = "Time_Value"; 
      chart.Series["Series4"].YValueMembers = "Total2_thruput"; 
      chart.Series["Series5"].XValueMember = "Time_Value"; 
      chart.Series["Series5"].YValueMembers = "BAWA_Total"; 
      chart.Series["Series5"].LegendText = "Count"; 
      chart.Series["Series5"].IsVisibleInLegend = true; 
      chart.DataBind(); 

      chart.Series["Series2"].LegendText = "Throughput1"; 
      chart.Series["Series2"].IsVisibleInLegend = true; 
      chart.Series["Series1"].LegendText = "Count1"; 
      chart.Series["Series1"].IsVisibleInLegend = true; 
      chart.Series["Series3"].LegendText = "Count2"; 
      chart.Series["Series3"].IsVisibleInLegend = true; 
      chart.Series["Series4"].LegendText = "Throughput2"; 
      chart.Series["Series4"].IsVisibleInLegend = true; 

      chart.ChartAreas[0].AxisX.LabelStyle.Angle = -90; 
      chart.ChartAreas[0].AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 6.00F, System.Drawing.FontStyle.Bold); 
      chart.ChartAreas[0].AxisX.Interval = 600; 
      chart.ChartAreas[0].AxisX.IsStartedFromZero = true; 
      chart.ChartAreas[0].AxisX.TitleFont = new System.Drawing.Font("Trebuchet MS", 10.00F, System.Drawing.FontStyle.Bold); 
      chart.ChartAreas[0].AxisY.TitleFont = new System.Drawing.Font("Trebuchet MS", 10.00F, System.Drawing.FontStyle.Bold); 
      chart.ChartAreas[0].AxisY2.TitleFont = new System.Drawing.Font("Trebuchet MS", 10.00F, System.Drawing.FontStyle.Bold); 

      chart.Legends[0].Docking = Docking.Bottom; 
      chart.Legends[0].IsDockedInsideChartArea = false; 
      chart.Legends[0].TableStyle = LegendTableStyle.Wide; 
      chart.Legends[0].Alignment = StringAlignment.Center; 
      chart.Series[0].ToolTip = "#VALY{d} (#VALX)"; 
      chart.Series[1].ToolTip = "#VALY{d} (#VALX)"; 
      chart.Series[2].ToolTip = "#VALY{d} (#VALX)"; 
      chart.Series[3].ToolTip = "#VALY{d} (#VALX)"; 
      chart.Series[4].ToolTip = "#VALY{d} (#VALX)"; 

回答

0

您还没有显示工具提示的代码。工具提示也可以显示一个常量字符串。你的意思是在工具提示中显示DataPoint的值吗?这个系列的chart.Series["Series5"].XValueMember = "Time_Value";是什么?其YValueMember未设置。除了这个问题还不清楚,你能解释一下吗?

+0

我正在从数据库中取值,并绑定到系列和工具提示。 – Amirtha