2017-05-31 26 views
1

SQL Server 2008 Connectionで動的データを使用してグラフC#を作成しました。 Label Seriesは水平位置にありますが、垂直位置(90°)に変更する必要があります。このコードはWebフォームを作成し、ラベルを追加します。グラフの角度をグラフの角度90°(垂直)に変更する方法C#

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

このコードはチャートに凡例とツールチップを追加します。私はチャートのプロパティをチェックしたが、見つからなかった!私を助けてください!絵は、今私のチャートであり、私はプロパティが「シリーズ」\ SmartLabelStyle選択にこれは、ソリューションです

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

おかげenter image description here

+0

あなたはSmartLabelStyleを無効にする必要があります。 – TaW

+0

ありがとうございますが、SmartLabelStyleはラベル位置を制御しません! –

+0

しかし、ラベルが回転している間は、ラベルは回転が必要でないことを知るのに十分スマートになります。デフォルトは 'true'です。それをテストするか、少なくともそれを見てください(https://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.smartlabelstyle(v = vs.110)。 aspx).. – TaW

答えて

0

を整理したいということを示します - フォント\ LabelAngleを選択し、偽 を - 90。 ご協力いただきありがとうございます! enter image description here

enter image description here

関連する問題