Dundas Chart for ASP.NET
Creating Cylinder-Type Charts
See Also Send comments on this topic.
Using Dundas Chart > Creating Specific Charts > Creating Cylinder-Type Charts



Glossary Item Box

Overview

All 3D bar and column-type charts, including Gantt charts, can be displayed using a cylindrical shape to represent their data points. The cylindrical shapes used can be applied to either an entire data series, or to a specific data point within a series. The resulting chart is seen in Figure 1 below.

 

Figure 1: 3D cylinders applied to data points and series.

 

To use cylindrical shapes, you must use the CustomAttributes property, and set its DrawingStyle custom attribute to Cylinder. This attribute can be set at either design-time as shown in Figure 2, or at run-time as demonstrated in the code example below. To apply cylindrical shapes to a single data point, use the CustomAttributes property of that DataPoint object. To apply cylindrical shapes to all data points in a Series, use the CustomAttributes property of that Series object.

 

Figure 2: Setting the DrawingStyle custom attribute for a series at design-time.

 

Note that there are two ways to set, and get, custom attributes at run-time:

  1. Using an indexer. If you use an indexer do not specify the CustomAttributes property. When you set a custom attribute this way only that particular attribute (name/value pair) will be set, or retrieved.
  2. Using the entire CustomAttributes name-value pair string expression. When you set custom attributes this way, all custom attributes of the object are set at once. Multiple custom attributes can be set using comma separated name-value pairs. When you get the CustomAttributes property value, you will be getting the entire name-value string expression.

 

The 3D Cylinder chart cannot be rendered using a Flash image type. 

For more information on how to set or get custom attributes, see the topic on Custom Attributes

Code Samples

Example

This example demonstrates how to use a cylinder-shape for the first and second data points in Series1, and all the data points for Series2. Note that we do this in two ways, first we set only the DrawingStyle custom attribute, then we overwrite all attributes with the DrawingStyle attribute.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...
  
' Set only the DrawingStyle custom attribute for first two points in Series1.
chart1.Series("Series1").Points(0)("DrawingStyle") = "Cylinder"
chart1.Series("Series1").Points(1)("DrawingStyle") = "Cylinder"

' Set only the DrawingStyle custom attribute for all points in Series2.
chart1.Series("Series2")("DrawingStyle") = "Cylinder"
  ...

' Set the DrawingStyle custom attribute for first two points in Series1,
' overwriting all other custom attributes.
chart1.Series("Series1").Points(0).CustomAttributes = "DrawingStyle=Cylinder"
chart1.Series("Series1").Points(1).CustomAttributes = "DrawingStyle=Cylinder"

' Set the DrawingStyle custom attribute for all points in Series2,
' overwriting all other custom attributes.
chart1.Series("Series2").CustomAttributes = "DrawingStyle=Cylinder"


C# Copy Code
using Dundas.Charting.WebControl;
  ...
  
// Set only the DrawingStyle custom attribute for first two points in Series1.
chart1.Series["Series1"].Points[0]["DrawingStyle"] = "Cylinder";
chart1.Series["Series1"].Points[1]["DrawingStyle"] = "Cylinder";

// Set only the DrawingStyle custom attribute for all points in Series2
chart1.Series["Series2"]["DrawingStyle"] = "Cylinder";
  ...

// Set the DrawingStyle custom attribute for first two points in Series1,
// overwriting all other custom attributes.
chart1.Series["Series1"].Points[0].CustomAttributes = "DrawingStyle=Cylinder";
chart1.Series["Series1"].Points[1].CustomAttributes = "DrawingStyle=Cylinder";

// Set the DrawingStyle custom attribute for all points in Series2,
// overwriting all other custom attributes.
chart1.Series["Series2"].CustomAttributes = "DrawingStyle=Cylinder";


See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.