은 내가 IENumerable<MyClass>
의 형태로, 단순한 객체 데이터 소스를 가지고의 MSChart하기 . 나는이 것으로 기대 :데이터 바인딩 ObjectDataSource를이
<asp:Chart runat="server" DataSourceID="datasource">
<Series>
<asp:Series XValueMember="Key" YValueMembers="Value1"/>
<asp:Series XValueMember="Key" YValueMembers="Value2"/>
</Series>
</asp:Chart>
<asp:ObjectDataSource ID="datasource" runat="server" SelectMethod="DataObjectMethodName" TypeName="DataObjectClassName"/>
을 그러나 나는 다음과 같은 예외가 나타납니다이 매핑 데이터 바인딩을 시도 할 때마다 :
Series data points do not support values of MyClass only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.
가 나는 또한 내 데이터 소스가 반환 할 시도를 Dictionary<DateTime, Int[]>
및 Dictionary<DateTime, MyClass>
, 성공없이.
단순한 디자인 - MSCharts에서 지원되지 않는 복잡한 개체에 대한 시간 데이터 바인딩? 나는 Dictionary<DateTime, int>
에 묶을 수 있었다. 결국 StackedColumn 유형의 차트 여야합니다.
이 질문에 답하지 않는 Multiple columns chart using asp.net chart control과 같은 비슷한 질문이 표시됩니다.