how to add mouseover tooltip in charts c#

c# charts

774 观看

1回复

58 作者的声誉

I want to show some information(value of column 'a') retrieving from data base when user hover mouse on the bar line. here is my code for displaying chart in C#. Please help

var query="select a,b,c from abc";
SqlCommand cmd = new SqlCommand(query, conn);
DataTable dt = new DataTable();
dt.Load(cmd.ExecuteReader());
Chart1.Series.Add("test");
Chart1.Series["test"].XValueMember = "a";
Chart1.Series["test"].YValueMembers = "b";
Chart1.DataSource = dt;
Chart1.DataBind();
作者: dan 的来源 发布者: 2017 年 9 月 15 日

回应 1


1

41 作者的声誉

决定

try something like this

chart1.Series["test"].ToolTip = "Y Value: #VALY";

For more controlled jquery tooltip, trying some like this

作者: Blue 发布者: 2017 年 9 月 15 日
32x32