Create a 3D chart in ASP.NET 4.0

Creating a 3D chart in ASP.NET 4.0 is a cakewalk! Let us take an example of converting a simple chart to a 3D chart in ASP.NET 4.0

The chart shown below is a simple Column chart

<asp:Chart ID="Chart1" runat="server"
DataSourceID="ObjectDataSource1">
<
Series>
<
asp:Series Name="Series1"
XValueMember="Year" YValueMembers="Revenue"
ChartType="Column">
</
asp:Series>
</
Series>
<
ChartAreas>
<
asp:ChartArea Name="ChartArea1">
</
asp:ChartArea>
</
ChartAreas>
</
asp:Chart>
<
asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetEstimates" TypeName="Estimate">
</
asp:ObjectDataSource>
 

image

To convert this chart into a 3D chart, you just need to add the Area3DStyle property inside the ChartArea object as show below:

    <ChartAreas>
<
asp:ChartArea Name="ChartArea1">
<
area3dstyle
Enable3D="True"
Inclination="10"
LightStyle="Realistic"
Perspective="15"
IsRightAngleAxes="False"
IsClustered="False" />
</
asp:ChartArea>

The result is a 3D chart.

image

With better designer skills, you can create some awesome 3D charts!

3 comments:

  1. kewl had no idea aspnet charts have this feature

    ReplyDelete
  2. It´s old from .NET 3.5

    http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&DisplayLang=en

    ReplyDelete
  3. Thanks very much for the post, simples :o)

    ReplyDelete