我有一个数据集,我想使用 VS 2010 中的内置图表将其呈现为堆积柱形图。数据如下所示,并从 SQL Server 从存储过程返回:
numTrades Type symbol
3 BreakEven GBPCHF
7 Loss GBPCHF
11 Win GBPCHF
1 BreakEven GBPJPY
3 Loss GBPJPY
7 Win GBPJPY
7 Loss GBPUSD
13 Win GBPUSD
我用于呈现图表的 ASP.Net 代码如下所示:
<asp:Chart
ID="chtWinnerPercentagePie"
runat="server"
DataMember="DefaultView"
Height="600px"
Palette="Pastel"
Width="900px"
AlternateText="WinLoss Pie"
SkinID="chartSkin"
ImageType="Png" >
<Series >
<asp:Series
Name="WinnersLosers"
ChartType="StackedColumn"
ChartArea="MainChartArea"
XValueMember="symbol"
YValueMembers="numTrades">
</asp:Series>
</Series>
<Legends>
<asp:Legend Name="Legend" ForeColor="#A1A5A9" BackColor="#161616" />
</Legends>
<ChartAreas>
<asp:ChartArea
Name="MainChartArea"
BackColor="#2C2C2C">
<AxisY Title="Num Trades" TitleForeColor="White">
<LabelStyle ForeColor="White" />
<MajorGrid LineColor="#000000" />
</AxisY>
<AxisX Enabled="True">
<LabelStyle ForeColor="White" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
<Titles>
<asp:Title
Name="ChartTitle"
Text="Win/Loss Ratio"
Font="Microsoft Sans Serif, 10pt"
ForeColor="#A1A5A9"
BackColor="#161616">
</asp:Title>
</Titles>
</asp:Chart>
我没有得到堆叠图表,而是在加载页面时得到了这个:http: //tinypic.com/r/66kljl/7
我哪里错了?