繁体   English   中英

如何将标签系列更改为图表c#的90°(垂直)角度

[英]How to change the Label Series to angle to 90°(vertical) of Chart c#

我使用SQL Server 2008 Connection开发了带有动态数据的图表C#。 标签系列位于水平位置,但我需要更改为垂直位置(90°)此代码构建了一个Web窗体并添加标签。

<asp:Chart ID="graf_hr_ralenti_vehiculo_mensual_comparativo" runat="server" Height="580px" Width="934px">
    <Series>
        <asp:Series CustomProperties="DrawingStyle=Cylinder" Legend="Legend1" Name="Series1" LabelAngle="90">
        </asp:Series>
        <asp:Series ChartArea="ChartArea1" CustomProperties="DrawingStyle=Cylinder" Legend="Legend1" Name="Series2">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
            <AxisY IsLabelAutoFit="False" TextOrientation ="Auto"
                    TitleFont="Verdana, 10pt" Interval="Auto">
                    <LabelStyle Font="Microsoft Sans Serif" />
            </AxisY>

            <AxisX IsLabelAutoFit="false" LabelAutoFitMaxFontSize="10" 
                    LabelAutoFitMinFontSize="8" LabelAutoFitStyle="None" Interval="1">
                    <LabelStyle Angle ="90" Font="Microsoft Sans Serif" IsEndLabelVisible ="false" />                            
            </AxisX>
        </asp:ChartArea>
    </ChartAreas>
    <Legends>
        <asp:Legend Name="Legend1">
        </asp:Legend>
    </Legends>
</asp:Chart>

此代码C#将图例和工具提示添加到图表。 我检查了图表的属性,但我找不到它! 你能帮我吗! 图片是我的图表现在,并告诉你我想组织

graf_hr_ralenti_vehiculo_mensual_comparativo.Titles.Add("Comparativa Vehiculos Ralenti Promedio \\n" + strmes + " VS " + strmes_comparativo).Font = new Font("Arial", 12, FontStyle.Bold);
graf_hr_ralenti_vehiculo_mensual_comparativo.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
graf_hr_ralenti_vehiculo_mensual_comparativo.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false;
graf_hr_ralenti_vehiculo_mensual_comparativo.Series["Series1"].ToolTip = "(#VALX, #VALY)";
graf_hr_ralenti_vehiculo_mensual_comparativo.Series["Series2"].ToolTip = "(#VALX, #VALY)";

graf_hr_ralenti_vehiculo_mensual_comparativo.Series["Series1"].LegendText = strmes;
graf_hr_ralenti_vehiculo_mensual_comparativo.Series["Series2"].LegendText = strmes_comparativo;

graf_hr_ralenti_vehiculo_mensual_comparativo.Legends["Legend1"].Title = "Segmentación";

谢谢 在此输入图像描述

这是解决方案,在属性中选择“Series”\\ SmartLabelStyle - False然后选择Font \\ LabelAngle -90。 谢谢你的帮助! 在此输入图像描述

在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM