簡體   English   中英

C#圖表顯示所有標簽

[英]C# chart show all labels

在C#Web應用程序上工作,我的問題是只有一些值出現在報表上(這是我正在談論的X軸,它只顯示其他所有值)。 它只是展示了每一個。 我怎樣才能展示所有這些?

謝謝

在此輸入圖像描述

在此輸入圖像描述

我的代碼:

<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>

我認為有些標簽會混淆價值觀。 原始問題是指跳過的標簽。

這是MS Chart的重復問題, 如果圖表中有超過9個條形,則ASP.NET圖表類型“列”不顯示軸x標簽

答案是

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM