ms 图表多个系列 X 值不匹配 (ASP.NET)
我目前正在开发一个网站,该网站显示我使用 SQL 表中的数据构建的多个图表。我使用并遵循了 Scott Mitchell 的教程(https://web.archive.org/web/20210927195532/http://www.4guysfromrolla.com/articles/093009-1.aspx)和 K. Scott Allen 的 ChartBuilder 类(http://code.msdn.microsoft.com/mag200903XASP/Release/ ProjectReleases.aspx?ReleaseId=2245)并且一切正常。
但是,当我想在同一个图表上显示两个系列时,如果一组数据不具有其他系列的所有 X 值,则图表会盲目地将所有数据放在上面,忽略尝试匹配的 X 值其他系列,因此在显示图表时 X 值不匹配。
我知道我可以修改数据,以便两组数据具有相同的 X 值,但是我试图让该类处理数据中的异常,这样我就不必太担心数据。
非常感谢任何帮助。
I'm currently developing a website that shows multiple charts that I build using data from SQL tables. I've used and followed Scott Mitchell's tutorial (https://web.archive.org/web/20210927195532/http://www.4guysfromrolla.com/articles/093009-1.aspx) and K. Scott Allen's ChartBuilder class (http://code.msdn.microsoft.com/mag200903XASP/Release/ProjectReleases.aspx?ReleaseId=2245) and all works well.
However when have two series that I want to show on the same Chart, if one set of data does not have all of the X values the other series does, the chart blindly puts all the data on, ignoring trying to match the X values of the other series, therefore mismatching the X values when the chart is shown.
I know that I can fiddle the data so that both sets of data have the same X values, however I'm trying to make the class handle anomalies in the data so that I don't have to worry too much about the data.
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Chart.DataBindCrossTab 为您匹配它。
请在此处查看更多信息: http ://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx
chart.DataBindCrossTab match it for you.
See more here: http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx