问题可能出在 aspx 方面。就我个人而言,我宁愿在 aspx 端绑定数据,然后使用硬代码。看看我的示例,您可以在其中设置方向(XValueMember="Date" YValueMembers="Counter"):
<asp:Chart ID="SiteVisitChart" runat="server" DataSourceID="StartedProcessesObjectDataSource"
Width="700px" Height="400px" >
<Series>
<asp:Series ToolTip="#VALX (#VALY)" Name="Series1" Color="112, 162, 213" BorderColor="164, 164, 164" ChartType="Column"
BorderDashStyle="Solid" BorderWidth="1" ShadowColor="128, 128, 128, 128" ShadowOffset="1"
IsValueShownAsLabel="true" XValueMember="Date" YValueMembers="Counter" Font="Tahoma, 8.0pt"
BackSecondaryColor="0, 102, 153" LabelForeColor="100, 100, 100">
<SmartLabelStyle Enabled="true" />
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BackColor="White" BorderColor="26, 59, 105" BorderWidth="0"
BorderDashStyle="Solid">
<AxisX Title='<% $resources:AppResource,Date %>' LineColor="204, 204, 204" TitleFont="Tahoma, 8pt"
TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="8" LabelAutoFitMinFontSize="8">
<MajorTickMark LineColor="Gray" />
<MajorGrid Enabled="false" />
<LabelStyle Font="Tahoma, 8.0pt" ForeColor="100, 100, 100" />
</AxisX>
<AxisY Title='<% $resources:AppResource,Counter %>' LineColor="204, 204, 204"
TitleFont="Tahoma, 8pt" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="8"
LabelAutoFitMinFontSize="8">
<MajorTickMark LineColor="Gray" />
<MajorGrid Enabled="false" />
<LabelStyle Font="Tahoma, 8.0pt" ForeColor="100, 100, 100" />
</AxisY>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
<asp:ObjectDataSource ID="StartedProcessesObjectDataSource" runat="server" SelectMethod="GetAllStartedProcessesStatistics"
TypeName="GP.Solutions.WF.Services.GPWFManager">
<SelectParameters>
<asp:Parameter Name="dateFrom" Type="DateTime" />
<asp:Parameter Name="dateTo" Type="DateTime" />
</SelectParameters>
</asp:ObjectDataSource>