开发者

C# chart show all labels

Working on a C# web app, my issue is that only some of the values are appearing on the report (This i开发者_JAVA技巧s the X Axis I'm talking about, it only shows every other value). Its simply showing every other one. How can I show all of them?

Thanks

C# chart show all labels

C# chart show all labels

My Code:

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


I think some are confusing values with labels. The original question refers to labels, which are being skipped.

This is a repeat question of MS Chart with ASP.NET chart type “column” not showing axis x label if there are more than 9 bar in the chart

The answer is

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜