2011-09-27 144 views
5

在C#web應用程序上工作時,我的問題是隻有一些值出現在報表上(這是我所說的X軸,它只顯示其他每個值)。它只是顯示其他每一個。我如何顯示所有這些?C#圖表顯示所有標籤

感謝

enter image description here

enter image description here

我的代碼:

<asp:Chart ID="Chart6" runat="server" DataSourceID="SqlDataSource13" 
       Palette="Chocolate" Width="800px"> 
       <Series> 
        <asp:Series Name="Series1" CustomProperties="DrawingStyle=Cylinder" 
         IsValueShownAsLabel="True" LabelFormat="{C2}" Palette="Chocolate" 
         XValueMember="StartItem" YValueMembers="STDCOST2"> 
        </asp:Series> 
       </Series> 
       <ChartAreas> 
        <asp:ChartArea Name="ChartArea1"> 
         <AxisY IsLabelAutoFit="False" TextOrientation="Rotated90" 
          TitleFont="Verdana, 7pt"> 
          <LabelStyle Font="Microsoft Sans Serif, 6.75pt" Format="{C2}" /> 
         </AxisY> 
         <AxisX IsLabelAutoFit="False" LabelAutoFitMaxFontSize="8" 
          LabelAutoFitMinFontSize="7" LabelAutoFitStyle="None"> 
          <LabelStyle Angle="90" Font="Microsoft Sans Serif, 6pt" Interval="Auto" 
           IsEndLabelVisible="False" /> 
          <ScaleBreakStyle BreakLineStyle="None" /> 
         </AxisX> 
         <AxisX2 IsLabelAutoFit="False" LabelAutoFitMaxFontSize="8" 
          LabelAutoFitStyle="None"> 
          <LabelStyle Angle="45" /> 
         </AxisX2> 
         <Area3DStyle Enable3D="True" /> 
        </asp:ChartArea> 
       </ChartAreas> 
      </asp:Chart> 
+0

什麼樣的報告,是什麼呢? –

+0

在我看來,每一個價值都在... –

+0

舉報? C#?你是否介意將你的問題語境化(把你的問題放在一個語境中)以便使它可以回答?隨着接近的選票開始下雨,快點。在目前的狀態下,我認爲您的問題的答案實際上是$ 6,708.34 –

回答

21

,我認爲有些是帶標籤的混亂值。原始問題涉及正在跳過的標籤。

這是MS Chart with ASP.NET chart type 「column」 not showing axis x label if there are more than 9 bar in the chart

回答重複的問題是

Chart6.ChartAreas["ChartArea1"].AxisX.Interval = 1; 
+0

謝謝,它幫助了我,這正是我一直在尋找的。 – Skalli

+0

釘住它!爲interval = 1工作,歡呼 –

+0

即使使用'Interval = 1',也只顯示1個系列。如何顯示所有系列的X標籤? – Leon