0

我正在使用 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);           
            }

它的工作但问题是当文本太长时它穿过图表而不是出现在两行中......

注释交叉图表的图表

4

1 回答 1

1

如果您可以在文本中明确换行,请尝试\n在“战略”位置插入。这样,您至少可以控制您手动编写的文本。

于 2012-09-17T07:22:37.300 回答