我正在使用 asp.net 3.5 图表控件并在没有数据时显示消息。我用过这个方法
if (dsAllDepartment.Tables[0].Rows.Count == 0)
{
System.Web.UI.DataVisualization.Charting.TextAnnotation annotation =
new System.Web.UI.DataVisualization.Charting.TextAnnotation();
annotation.Text =ddldepartment.SelectedItem.Text+" विभाग के लिए डाटा उपलब्ध नहीं है";
annotation.X = 5;
annotation.Y = 25;
annotation.Font = new System.Drawing.Font("Arial", 12);
annotation.ForeColor = System.Drawing.Color.Red;
chAllDepartmentAllActivity.Annotations.Add(annotation);
}
它的工作但问题是当文本太长时它穿过图表而不是出现在两行中......