彩票走势图

如何利用TeeChart图表控件制作趋势图提示框

转帖|其它|编辑:郝浩|2012-10-15 16:31:07.000|阅读 643 次

概述:在本次的文章里,想和大家分享如何利用TeeChart图表控件制作趋势图提示框。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

在本次的文章里,想和大家分享如何利用TeeChart图表控件制作趋势图提示框 。

将鼠标移动到POINT上时,显示该点的值;其实就是在一条FASTLINE上再画一组点,二者重叠。

下面是我制作时候的源码,供大家参考:

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;
            //-------------------------------------------------------------------//

        }


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn

文章转载自:博客园

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP