C#图表显示所有标签

标签 c#

在 C# 网络应用程序上工作时,我的问题是只有部分值出现在报告中(这是我所说的 X 轴,它只显示所有其他值)。它只是显示每个其他的。我怎样才能显示所有这些?

谢谢

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>

最佳答案

我认为有些混淆了值和标签。原来的问题是指被跳过的标签。

这是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; 

关于C#图表显示所有标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7575015/

相关文章:

c# - 角色移动、加速 C# Unity

c# - 设置EF拦截器文件名布局

c# - 对 DropdownList 使用枚举 : Missing a using directive or assembly reference

c# - 如何获取执行线程的核心/处理器ID?

c# - 在 Compact Framework 中删除只读

c# - 如何在 Crystal 报表中合并行?

c# - 重新创建 TextBox 控件

c# - ASP.Net 表单数据绑定(bind)问题

c# - 防止我的窗口在短时间不活动时闪烁

c# - 在调用 Shutdown 然后在 Socket 上关闭时获取 ObjectDisposed 异常