If you are using the Dundas chart you are able to have drop lines.
The first way is to make the Line chart an area chart and use the
change the chart type to an 3D Area chart. Then set the 3D rotation
such that you are looking directly at the chart (no rotation at all)
and set the "ShowMarkerLines" attribute to True. Also, set the Area
color to Transparent and you will have the effect you want.
The other alternative is to custom paint the lines yourself via one of
the chart paint events. I suggest the PostPaint event. The code below
does a fine job:
if(sender is ChartArea)
{
Graphics graph = e.ChartGraphics.Graphics;
PointF p1 = PointF.Empty;
PointF p2 = PointF.Empty;
double p1X, p2X, p1Y, p2Y;
float relX1, relY1, relX2, relY2;
// draw a dotted line to from each point to the X axis
// get the first series
foreach(Series ser in chartObj.Series)
{
// and for each data point in each series
foreach(DataPoint pt in ser.Points)
{
// get each value that we care about
p1X = p2X = pt.XValue;
p1Y = pt.YValues[0];
p2Y = 0;
// convert the value to a relative position value
relX1 =
(float)e.ChartGraphics.GetPositionFromAxis(ser.ChartArea,AxisName.X,p1X);
relY1 =
(float)e.ChartGraphics.GetPositionFromAxis(ser.ChartArea,AxisName.Y,p1Y);
relX2 =
(float)e.ChartGraphics.GetPositionFromAxis(ser.ChartArea,AxisName.X,p2X);
relY2 =
(float)e.ChartGraphics.GetPositionFromAxis(ser.ChartArea,AxisName.Y,p2Y);
PointF point1 = PointF.Empty;
PointF point2 = PointF.Empty;
// assign the relative values to a PointF structure
point1.X = relX1;
point1.Y = relY1;
point2.X = relX2;
point2.Y = relY2;
// Convert relative coordinates to absolute pixel coordinates.
point1 = e.ChartGraphics.GetAbsolutePoint(point1);
point2 = e.ChartGraphics.GetAbsolutePoint(point2);
// Draw connection line
Pen dashLine = new Pen(ser.Color, 1);
dashLine.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
graph.DrawLine(dashLine, point1,point2);
} // end of foreach data point
} // end of foreach series
} // end of if sender ...
Both solutions will work with our asp.net, windows forms or Reporting
Services chart.
Thanks
Andrew Bryan
Dundas Software
[quoted text, click to view] bob wrote:
> It cant be done in reporting services .. or dundas or web chart..
>
> Havent found one that can do it yet
>
> From
http://www.developmentnow.com/g/115_2005_4_0_0_511446/Graph-Drop-lines.htm >
> Posted via DevelopmentNow.com Groups
>
http://www.developmentnow.com