在asp.net使用chart组件,遇上一个错误:

Cannot display indexed series (XValueIndexed = true) on the same axis if they are not aligned.A chart element with the name 'A32' could not be found in the 'SeriesCollection'  。

 

这个异常是调用 Char.DataBindCrossTable(....) 引发的。

检查下来,发现在轴字段,数据中有空格 "A32 " , 将空格去掉即可。

 

这应该是chart组件的一个小BUG,在生成轴时候,未将数据trim,在填充的时候,将数据trim ,造成找不到元素的错误。

 

记录一下,希望对遇上相同问题的程序员一点帮助。

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2021-08-09
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-02-22
  • 2021-05-17
猜你喜欢
  • 2021-06-18
  • 2021-10-01
  • 2021-12-30
  • 2021-12-07
  • 2021-11-20
  • 2022-01-11
  • 2021-12-04
相关资源
相似解决方案