在LineSeries WinForms图表中显示工具提示? [英] Show tooltip in LineSeries WinForms Chart?

查看:86
本文介绍了在LineSeries WinForms图表中显示工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WinForms中的折线图的仪表板系统.我需要在每一行上显示tooptip.我已经尝试过了

I am working on a Dashboard System where i am using Line Chart in WinForms. I need to show the tooptip on each line. I have tried this

var series = new Series
                    {
                        Name = chartPoint.SetName,
                        Color = chartPoint.ChartColor,
                        ChartType = SeriesChartType.Line,
                        BorderDashStyle = chartPoint.ChartDashStyle,
                        BorderWidth = chartPoint.BorderWidth,
                        IsVisibleInLegend = !chartPoint.HideLegend,
                        ToolTip = "Hello World"
                    };

但对我不起作用

推荐答案

一些RnD之后,我得到了Line Series的工具提示,但仍然感到困惑,为什么它不适用于此解决方案. 这是解决方案

After some RnD i got tooltips on Line Series, but still confused why its not working with this solution. Here is the solution

series.ToolTip = string.Format("Name '{0}' : X - {1} , Y - {2}", chartPoint.SetName, "#VALX{F2}",
                                               "#VALY{F2}");
        mainChartControl.GetToolTipText += ChartControlGetToolTipText;

 private void ChartControlGetToolTipText(object sender, ToolTipEventArgs e)
    {
    }

这篇关于在LineSeries WinForms图表中显示工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆