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!






About The Author

Suprotim Agarwal
Suprotim Agarwal, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

3 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

Mike said...

Thanks very much for the post, simples :o)