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!



Will you give this article a +1 ? Thanks in advance


About The Author

Suprotim Agarwal
Suprotim Agarwal, ASP.NET Architecture MVP (Microsoft Most Valuable Professional) works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He is the Editor of a Developer Magazine called DNC Magazine. He has also written two EBooks 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook

Follow him on twitter @suprotimagarwal

4 comments:

Revol said...

kewl had no idea aspnet charts have this feature

Mike said...

It´s old from .NET 3.5

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

Aji Issac said...

Thanks for the detailed tutorial. Have you tried http://www.fusioncharts.com/aspnet/ (The product used by Google, FB and over 14000 top fellows) ... What I like the most is the simplicity it offers to the developers.

Mike said...

Thanks very much for the post, simples :o)