02-28-2005 11:50 AM
while( _xAxis.CustomDivisions.Count != 0 && _xAxis.CustomDivisions[0].Value > clearStep )
{
_xAxis.CustomDivisions.RemoveAt( 0 );
}
03-01-2005 11:25 AM
03-02-2005 09:49 AM
public class TiledImage : FillStyle
{
private Image _image;
public TiledImage(Image image)
{
if(image == null)
throw new ArgumentNullException("image");
_image = image;
}
public override bool IsContextDependent
{
get
{
//means createBrush is called when the context bounds change.
//In our case the annotation image bounds.
return true;
}
}
public override Brush CreateBrush(object context, FillStyleDrawArgs e)
{
TextureBrush brush = brush = new TextureBrush(_image, WrapMode.Tile);
Rectangle bounds = e.ContextBounds;
//translate brush to bounds desired.
brush.TranslateTransform(bounds.X, bounds.Y);
return brush;
}
}
_annotation.ShapeFillStyle = new TiledImage(_imageList.Images[0]);
03-03-2005 08:00 PM
03-07-2005 03:22 AM
03-07-2005 10:31 PM
void HighlightThresholdPoints(AfterDrawXYPlotEventArgs e, double threshold)
{
if (e.Plot.HistoryCount > 0)
{
// This overload of ClipDataPoints returns the points that are
// currently in the plot's axis ranges.
double[] xData, yData;
e.Plot.ClipDataPoints(out xData, out yData);
for (int i = 0; i < xData.Length; ++i)
{
double xPoint = xData[i], yPoint = yData[i];
if (yPoint > threshold)
{
// Map the current data point to the corresponding screen
// coordinate.
PointF point = e.Plot.MapDataPoint(e.Bounds, xPoint, yPoint);
// Highlight the current data point.
using (Brush brush = new SolidBrush(Color.FromArgb(128, Color.Red)))
using (Pen pen = new Pen(Color.Yellow))
{
RectangleF highlightBounds = new RectangleF(point.X - 5, point.Y - 5, 10, 10);
e.Graphics.FillEllipse(brush, highlightBounds);
e.Graphics.DrawEllipse(pen, highlightBounds);
}
}
}
}
}
private void OnAfterDrawPlot(object sender, AfterDrawXYPlotEventArgs e)
{
HighlightThresholdPoints(e, 7);
}
03-08-2005 03:25 AM
03-08-2005 02:09 PM