Reputation: 126
I am a bit confused with Asp:Chart, I have a table that returns one row
now I want it to be displayed in Asp:chart with ChartType="Column".
I converted the above table into the format
I used one series
<asp:Chart ID="charttest" runat="server" Width="950px" Height="250px">
<Series>
<asp:Series Name="Categories" IsValueShownAsLabel="true"
ChartArea="MainChartArea"
ChartType="Column" Legend="legend1" >
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea" Area3DStyle-Enable3D="true"
Area3DStyle-IsClustered="true" BorderWidth="1"
Area3DStyle-WallWidth="1" Area3DStyle-
PointGapDepth="50" Area3DStyle-PointDepth="100" Area3DStyle-
Rotation="10">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="legend1" BorderColor="Blue" ></asp:Legend>
</Legends>
</asp:Chart>
Problem:
a. The graph was showing properly but there was only one legend, couldn't change the label into percentage from code behind.
Then, I used multiple series but
<asp:Chart ID="charttest" runat="server" Width="950px"
Height="250px">
<Series>
<asp:Series Name="Categories" IsValueShownAsLabel="true"
ChartArea="MainChartArea"
ChartType="Column" Legend="legend1" >
</asp:Series>
<asp:Series Name="Categories2" IsValueShownAsLabel="true"
ChartArea="MainChartArea"
ChartType="Column" Legend="legend1" >
</asp:Series>
<asp:Series Name="Categories3" IsValueShownAsLabel="true"
ChartArea="MainChartArea"
ChartType="Column" Legend="legend1" >
</asp:Series>
<asp:Series Name="Categories4" IsValueShownAsLabel="true"
ChartArea="MainChartArea"
ChartType="Column" Legend="legend1" >
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea" Area3DStyle-Enable3D="true"
Area3DStyle-IsClustered="true" BorderWidth="1" Area3DStyle-
WallWidth="1" Area3DStyle-PointGapDepth="50" Area3DStyle-
PointDepth="100" Area3DStyle-Rotation="10">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="legend1" BorderColor="Blue" ></asp:Legend>
</Legends>
</asp:Chart>
Problem:
a. The legend was showing properly and I was able to show label in percentage but the axis value weren't getting displayed, It must be displaying those bars with space between them.
Can you tell me how should I solve this problem.
Upvotes: 0
Views: 3928