all groups > sql server reporting services > april 2005 >
You're in the

sql server reporting services

group:

Graph Drop lines


Graph Drop lines Bryan Avery
4/28/2005 11:40:16 PM
sql server reporting services:
Within Excel you can create Drop Lines in line graphs, is it possible
in the Graph Control in Reporting Services?
Re: Graph Drop lines Bryan Avery
5/1/2005 8:40:02 AM
Does this mean it can't be done, or know ones knows what this is?
RE: Graph Drop lines bob
10/29/2006 9:59:28 PM
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
Re: Graph Drop lines andrewb NO[at]SPAM dundas.com
11/2/2006 11:33:43 AM
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]
AddThis Social Bookmark Button