如何在鼠标悬停在 C# Web 应用程序上时在 Ms Chart 中显示数据
我正在使用 MS chat sp 线,我希望当我将光标移至图表上的任何点时,它会显示该特定点的读数,因为我的图表希望
DataView dv = dtGroupedBy.DefaultView;
dv.Sort = "DATE";
chart1.DataSource = dv;
chart1.DataBind();
<asp:chart runat="server" ID="chart1" Height="432px" Width="923px"
style="margin-top: 0px">
<Series>
<asp:Series Name="Series1" ChartType="Spline" XValueMember="DATE" YValueMembers="POWER"
Color="LightGreen">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<AxisX Title="Days">
</AxisX>
<AxisY Title="Electricity in KW">
</AxisY>
</asp:ChartArea>
</ChartAreas>
</asp:chart>
得到您的答复。
i am using ms chat sp line i want that when i take my cursor to the chart to any point it will show the reading at that particular point as my chart is as
DataView dv = dtGroupedBy.DefaultView;
dv.Sort = "DATE";
chart1.DataSource = dv;
chart1.DataBind();
<asp:chart runat="server" ID="chart1" Height="432px" Width="923px"
style="margin-top: 0px">
<Series>
<asp:Series Name="Series1" ChartType="Spline" XValueMember="DATE" YValueMembers="POWER"
Color="LightGreen">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<AxisX Title="Days">
</AxisX>
<AxisY Title="Electricity in KW">
</AxisY>
</asp:ChartArea>
</ChartAreas>
</asp:chart>
Hopes for your reply..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定 asp 图表是否提供有关数据点的工具提示。如果是,请使用它,否则在创建图表后将每个点和图像映射的自定义 div 写入 html 输出。
Not sure if asp chart provides tooltip on data points. If yes use it, else write custom div's for each point and image map to the html output after chart is being created.
在您的代码隐藏页面中,尝试在加载图表时添加以下内容:
Chart1.Series["Series1"].ToolTip = "#VALX, #VALY";
#VALX 和 #VALY 是下面描述的许多变量中的一些,您可以将它们添加到工具提示中。
http://support2.dundas.com/Default.aspx?article=1132
In your codebehind page try adding this when you load your chart:
Chart1.Series["Series1"].ToolTip = "#VALX, #VALY";
#VALX and #VALY are some of many variables described below that you can add to the tooltip.
http://support2.dundas.com/Default.aspx?article=1132