轉(zhuǎn)帖|其它|編輯:郝浩|2012-10-15 16:31:07.000|閱讀 667 次
概述:在本次的文章里,想和大家分享如何利用TeeChart圖表控件制作趨勢(shì)圖提示框。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在本次的文章里,想和大家分享如何利用TeeChart圖表控件制作趨勢(shì)圖提示框 。
將鼠標(biāo)移動(dòng)到POINT上時(shí),顯示該點(diǎn)的值;其實(shí)就是在一條FASTLINE上再畫一組點(diǎn),二者重疊。
下面是我制作時(shí)候的源碼,供大家參考:
private Steema.TeeChart.Styles.FastLine area1, area2; private Steema.TeeChart.Styles.Points points1, points2; private Steema.TeeChart.Tools.MarksTip tooltip1, tooltip2; private void Form1_Load(object sender, EventArgs e) { area1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart); points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart); area2 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart); points2 = new Steema.TeeChart.Styles.Points(tChart1.Chart); tooltip1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart); tooltip2 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart); //--------------------------------------------------------// tChart1.Aspect.View3D = false; area1.Add(1, 10); area1.Add(2, 15); area1.Add(3, 20); area1.Add(4, 25); area1.Add(5, 30); area2.FillSampleValues(); points1.DataSource = area1; points2.DataSource = area2; points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond; points2.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond; tooltip1.Series = points1; points1.Color = area1.Color; points1.Pointer.Pen.Color = area1.LinePen.Color; tooltip2.Series = points2; //---------------------------------------------------------------// points2.Color = area2.Color; points2.Pointer.Pen.Color = area2.LinePen.Color; tooltip1.MouseDelay = 50; tooltip1.MouseAction = Steema.TeeChart.Tools.MarksTipMouseAction.Move; tooltip1.Style = Steema.TeeChart.Styles.MarksStyles.XY; tooltip2.MouseAction = Steema.TeeChart.Tools.MarksTipMouseAction.Move; tooltip2.Style = Steema.TeeChart.Styles.MarksStyles.Value; //-------------Style Legend-----------------------------------------// points1.ShowInLegend = false; points2.ShowInLegend = false; tChart1.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Values; //-------------------------------------------------------------------// }
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:博客園