1
A
回答
3
試試這個:
protected void ChartExample_DataBound(object sender, EventArgs e)
{
// If there is no data in the series, show a text annotation
if(ChartExample.Series[0].Points.Count == 0)
{
System.Web.UI.DataVisualization.Charting.TextAnnotation annotation =
new System.Web.UI.DataVisualization.Charting.TextAnnotation();
annotation.Text = "No data for this period";
annotation.X = 5;
annotation.Y = 5;
annotation.Font = new System.Drawing.Font("Arial", 12);
annotation.ForeColor = System.Drawing.Color.Red;
ChartExample.Annotations.Add(annotation);
}
}
感謝
相關問題
- 1. asp:圖表控件中的錯誤
- 2. 如何在登錄表單模式中顯示錯誤消息?
- 3. 如何在alt消息中顯示錶
- 4. asp圖表錯誤
- 5. 如何控制在CakePHP表單中顯示錯誤消息div的位置?
- 6. 如何在圖表控件中顯示EMGU直方圖?
- 7. 如何在asp:圖表控件中重疊圖形
- 8. 顯示一個錯誤消息,當圖表不會出現
- 9. 如何在img ASP控件中顯示圖像?
- 10. 顯示錶單錯誤消息
- 11. 在圖表js 2中顯示錯誤信息
- 12. 在顯示錶中的任何消息
- 13. 如何在rails視圖上顯示錯誤消息?
- 14. ASP圖表控件不顯示任何內容
- 15. 在Angularjs中顯示圖標和自定義消息的錯誤
- 16. Angular2 - 捕獲異常並在視圖中顯示錯誤消息
- 17. asp:圖表控件在web服務器中不顯示任何內容
- 18. 在ASP中顯示消息框
- 19. 在表單驗證中同時顯示所有錯誤消息
- 20. 如何在ASP.NET的圖表控件中水平顯示X - AxisLabel
- 21. 如何在ASP.NET圖表控件中顯示值
- 22. 如何在列表視圖控件中顯示記錄?
- 23. 在PHP中顯示錯誤消息
- 24. 在窗體中顯示錯誤消息
- 25. 在laravel中未顯示錯誤消息
- 26. 在Qt/QML中顯示錯誤消息
- 27. 在html中顯示錯誤消息
- 28. 在php中顯示錯誤消息
- 29. 在rails中顯示錯誤消息
- 30. 消息框在C#中顯示錯誤
你有什麼迄今所做? –
如果條件像這樣使用... –
if(myTbl.Rows.Count == 0) { Chart1。??? =「此期間沒有數據」; } else { //我的圖表 –