原創(chuàng)|其它|編輯:郝浩|2012-11-16 15:25:56.000|閱讀 1274 次
概述:在這個(gè)例子中我們將使用DevExpress控件XtraChart來(lái)演示如何在運(yùn)行時(shí)為圖表添加和修改標(biāo)題。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在這個(gè)例子中我們將使用DevExpress控件XtraChart來(lái)演示如何在運(yùn)行時(shí)為圖表添加和修改標(biāo)題。
C#
// Create chart titles. ChartTitle chartTitle1 = new ChartTitle(); ChartTitle chartTitle2 = new ChartTitle(); // Define the text for the titles. chartTitle1.Text = "<i>Basic</i> <b>HTML</b> <u>is</u> <color=blue>supported</color>."; chartTitle2.Text = "The capability to word-wrap is available for chart titles."; chartTitle2.WordWrap = true; chartTitle2.MaxLineCount = 2; // Define the alignment of the titles. chartTitle1.Alignment = StringAlignment.Center; chartTitle2.Alignment = StringAlignment.Near; // Place the titles where it's required. chartTitle1.Dock = ChartTitleDockStyle.Top; chartTitle2.Dock = ChartTitleDockStyle.Bottom; // Customize a title's appearance. chartTitle1.Antialiasing = true; chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold); chartTitle1.TextColor = Color.Red; chartTitle1.Indent = 10; // Add the titles to the chart. chartControl1.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2}); VB
' Create chart titles. Dim chartTitle1 As New ChartTitle() Dim chartTitle2 As New ChartTitle() ' Define the text for the titles. chartTitle1.Text = "<i>Basic</i> <b>HTML</b> <u>is</u> <color=blue>supported</color>." chartTitle2.Text = "The capability to word-wrap is available for chart titles." chartTitle2.WordWrap = True chartTitle2.MaxLineCount = 2 ' Define the alignment of the titles. chartTitle1.Alignment = StringAlignment.Center chartTitle2.Alignment = StringAlignment.Near ' Place the titles where it's required. chartTitle1.Dock = ChartTitleDockStyle.Top chartTitle2.Dock = ChartTitleDockStyle.Bottom ' Customize a title's appearance. chartTitle1.Antialiasing = True chartTitle1.Font = New Font("Tahoma", 14, FontStyle.Bold) chartTitle1.TextColor = Color.Red chartTitle1.Indent = 10 ' Add the titles to the chart. chartControl1.Titles.AddRange(New ChartTitle() { chartTitle1, chartTitle2})
標(biāo)簽:
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@ke049m.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)