在ASP.Net Chart Control中显示Z轴,用于3D柱形图

时间:2013-07-17 19:15:27

标签: asp.net microsoft-chart-controls

我是asp.net图表控件的新手。我正在绘制使用相同的3D柱形图。在excel中,当我们绘制相同的图表时,我们可以选择在所有3轴上绘制数据。即X Y和Z.但是在asp.net图表控件的情况下,我只能创建两个轴,即x和y。我知道我们可以创建一个辅助y轴和x轴,但是我可以用任何方式显示Z轴。下面是我用来生成图表的代码。

<asp:Chart ID="Chart1" runat="server" Height="208px" Width="395px"
        Palette="Bright" BackColor="Silver"   >
   <series>  
           <asp:Series Name="Car" YValuesPerPoint="2">             
            <Points>                    
                <asp:DataPoint AxisLabel="Car"  YValues="85,0"/>
                <asp:DataPoint AxisLabel="Pencil"  YValues="43,0"/>
                <asp:DataPoint AxisLabel="Pen"  YValues="89,0"/>
                <asp:DataPoint AxisLabel="Rubber"  YValues="96,0"/>

            </Points>
           </asp:Series>  
           <asp:Series Name="Pencil" YValuesPerPoint="2">   

            <Points>         
                <asp:DataPoint AxisLabel="Car"  YValues="43,0"/>
                <asp:DataPoint AxisLabel="Pen"  YValues="0,0"/>
                <asp:DataPoint AxisLabel="Pencil"  YValues="28,0"/>
                <asp:DataPoint AxisLabel="Rubber"  YValues="7,0"/>

            </Points>
           </asp:Series>   
            <asp:Series   Name="Pencil" YValuesPerPoint="2">

            <Points>
                <asp:DataPoint AxisLabel="Car"  YValues="86,0" />
                <asp:DataPoint AxisLabel="Pen"  YValues="46,0"/>
                <asp:DataPoint AxisLabel="Pencil"  YValues="6,0"/>
                <asp:DataPoint AxisLabel="Rubber"  YValues="7,0"/>
            </Points>
           </asp:Series>     
           <asp:Series   Name="Rubber" YValuesPerPoint="2"> 

            <Points>
                <asp:DataPoint AxisLabel="Car"  YValues="36,0"/>
                <asp:DataPoint AxisLabel="Pen"  YValues="41,0"/>
                <asp:DataPoint AxisLabel="Pencil"  YValues="42,0"/>
                <asp:DataPoint AxisLabel="Rubber"  YValues="30,0"/>
            </Points>
           </asp:Series>            
      </series> 
       <ChartAreas>  
           <asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64"  
    BorderDashStyle="Solid" BackSecondaryColor="White" 
    BackColor="64, 165, 191, 228" 
    ShadowColor="Transparent" BackGradientStyle="TopBottom" >  
               <area3dstyle Rotation="30" perspective="10" Inclination="20" Enable3D="true" LightStyle="Realistic"   
    IsRightAngleAxes="False" IsClustered="False"></area3dstyle>  
               <axisy linecolor="64, 64, 64, 64" >  

                   <majorgrid linecolor="64, 64, 64, 64" />  
               </axisy>  
               <axisx linecolor="64, 64, 64, 64" Interval="1"  ArrowStyle="SharpTriangle" IsMarksNextToAxis="false">  


               </axisx>  

           </asp:ChartArea>  

       </ChartAreas>  

    </asp:Chart>

0 个答案:

没有答案