Hello Tom,
You can add your own MapArea
objects using the collections Add
method. When you create new MapArea
objects, specify their shape (circle, rectangle or polygon) and the coordinates
of the area to be created. You can do this at design time, using the collection
editor, or using code. For example:
MapArea a = new MapArea();
a.Shape = AreaShapeEnum.Rectangle;
a.Coords = new int[] { 169,225,175,240 };
a.Tooltip = "My Custom Area";
_c1wc.ImageAreas.Add(a);
The coordinates are specified as an array of integers.
This array corresponds to the coords attribute of the <area> tag. The
meaning of the array elements depends on the shape of the area:
|
Shape |
Coords |
Description |
|
Circle |
"x1,y1,r" |
x1,y2 are the coordinates of the center of the
circle, and r is the radius of the circle. |
|
Polygon |
"x1,y1,x2,y2...xn,yn" |
Each x,y pair contains the coordinates of one vertex
of the polygon. |
|
Rectangle |
"x1,y1,x2,y2" |
x1,y1 are the coordinates of the upper-left corner
of the rectangle and x2,y2 are the coordinates of the lower-right
coordinates of the rectangle. |
The ImageAreas
property is a collection of MapArea
objects. Each MapArea
object has properties that specify a ToolTip to be displayed when the user moves the mouse over
the area, and an action to be performed when the area is clicked.
The ImageAreas
property has a set of built-in areas, created automatically by the control:
· ChartArea,
PlotArea
· AxisX, AxisY,
AxisY2
· ChartData
(one <area> tag per data point or series)
· ChartLabel
(one <area> tag per label)
· Header,
Footer
· Legend,
LegendItem (one <area> tag per item)
I
hope it helps,
Regards,
Andrew
I'm looking for a way to programmatically assign the tooltip text for each
piece of chart data. For instance, I have a stacked bar chart and I want
to have the pieces of the stacked bar to all have the same tooltip display
that shows the combined total for the stacked bar.
Another use for this is for programmatically performing a calculation on
the data and using the result as a tooltip for each chart data item. If
you know of a way to accomplish this; will you please share your
knowledge?
--
tomS.
http://helpcentral.componentone.com/cs/forums/p/74744/203205.aspx#203205