How to create Dynamic Height of legend in chart.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shashi shekhar1
    New Member
    • Jun 2012
    • 1

    #1

    How to create Dynamic Height of legend in chart.

    When the title of legend is more then the chart becomes smaller. How can we increase the height of legend without affecting the chart. Here is my Code.

    Code:
    <asp:Chart ID="Chart2" runat="server" Width="420" Height="300" ImageStorageMode="UseImageLocation">
      <Series>
        <asp:Series Name="Series1" 
            ChartType="Pie" 
            XValueMember="ControlType"
            ValueMembers="ControlAmount"
            ToolTip="#PERCENT" 
            Label="#PERCENT" 
            LegendText="#AXISLABEL">
        </asp:Series>
      </Series>
      <ChartAreas>
        <asp:ChartArea Name="ChartArea1" 
            Area3DStyle-Enable3D="true"
            Area3DStyle-IsClustered="true"
            Area3DStyle-Perspective="10" 
            Area3DStyle-PointGapDepth="900" 
            Area3DStyle-IsRightAngleAxes="false"
            Area3DStyle-WallWidth="25" 
            Area3DStyle-Rotation="50" 
            Area3DStyle-Inclination="35"
            BackColor="Transparent" 
            BackSecondaryColor="Transparent">
        </asp:ChartArea>
      </ChartAreas>
      <Legends>
        <asp:Legend Name="statuslegend" 
            Alignment="Near" 
            TitleAlignment="Near" 
            InterlacedRows="true" 
            LegendItemOrder="Auto" 
            Docking="Right"  
            IsTextAutoFit="false"
            LegendStyle="Table" 
            Font="Tahoma, 8.60pt">
        </asp:Legend>
      </Legends>
      <BorderSkin SkinStyle="Emboss" />
      <Titles>
        <asp:Title Name="Title1" 
            Font="Times New Roman, 13pt" 
            Text="<%$ Resources:Resource, Incidentssortedbytype %>"
            ForeColor="#324A70" 
            ShadowOffset="3" 
            ShadowColor="32, 0, 0, 0">
        </asp:Title>
      </Titles>
    </asp:Chart>
    Last edited by Frinavale; Jun 5 '12, 01:07 PM. Reason: Added formatting to code so that it is readable
Working...