1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
|
//
// Authors:
// Jonathan Pobst (monkey@jpobst.com)
// Francis Fisher (frankie@terrorise.me.uk)
//
// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.ComponentModel;
using System.Data.Common;
namespace System.Windows.Forms.DataVisualization.Charting
{
public class Chart : Control, ISupportInitialize, IDisposable
{
public Chart ()
{
BackColor = Color.White;
ChartAreas = new ChartAreaCollection ();
Series = new SeriesCollection ();
}
public AnnotationCollection Annotations { get; private set;}
public AntiAliasingStyles AntiAliasing { get; set; }
public override Color BackColor { get; set; }
public GradientStyle BackGradientStyle { get; set; }
public override Image BackgroundImage { get; set; }
public ChartHatchStyle BackHatchStyle { get; set; }
public string BackImage { get; set; }
public ChartImageAlignmentStyle BackImageAlignment { get; set; }
public Color BackImageTransparentColor { get; set; }
public ChartImageWrapMode BackImageWrapMode { get; set; }
public Color BackSecondaryColor { get; set; }
public Color BorderColor { get; set; }
public ChartDashStyle BorderDashStyle { get; set; }
public Color BorderlineColor { get; set; }
public ChartDashStyle BorderlineDashStyle { get; set; }
public int BorderlineWidth { get; set; }
public BorderSkin BorderSkin { get; set; }
public int BorderWidth { get; set; }
public string BuildNumber { get; private set;}
public ChartAreaCollection ChartAreas { get; private set; }
public DataManipulator DataManipulator { get; private set;}
public Object DataSource { get; set; }
protected override Size DefaultSize { get { return base.DefaultSize; } }//FIXME
public override Color ForeColor { get; set; }
public NamedImagesCollection Images { get; private set;}
public bool IsSoftShadows { get; set; }
public LegendCollection Legends { get; private set; }
public ChartColorPalette Palette { get; set; }
public Color[] PaletteCustomColors { get; set; }
public PrintingManager Printing { get; private set;}
public double RenderingDpiX { get; set; }
public double RenderingDpiY { get; set; }
public ChartSerializer Serializer { get; private set; }
public SeriesCollection Series { get; private set; }
public bool SuppressExceptions { get; set; }
public TextAntiAliasingQuality TextAntiAliasingQuality { get; set; }
public TitleCollection Titles { get; private set;}
#region Protected Properties
protected override void OnPaint (PaintEventArgs e)
{
base.OnPaint (e);
ChartGraphics g = new ChartGraphics (e.Graphics);
PaintElement (g, this, new ElementPosition (0, 0, 100, 100));
foreach (var area in ChartAreas)
PaintElement (g, area, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
foreach (var series in Series)
PaintElement (g, series, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
}
protected override void OnPaintBackground (PaintEventArgs pevent)
{
base.OnPaintBackground (pevent);
}
protected virtual void OnPostPaint (ChartPaintEventArgs e)
{
}
protected virtual void OnPrePaint (ChartPaintEventArgs e)
{
}
#endregion
public event EventHandler AnnotationPlaced;
public event EventHandler AnnotationPositionChanged;
public event EventHandler<AnnotationPositionChangingEventArgs> AnnotationPositionChanging;
public event EventHandler AnnotationSelectionChanged;
public event EventHandler AnnotationTextChanged;
public event EventHandler<ScrollBarEventArgs> AxisScrollBarClicked;
public event EventHandler<ViewEventArgs> AxisViewChanged;
public event EventHandler<ViewEventArgs> AxisViewChanging;
public event EventHandler<CursorEventArgs> CursorPositionChanged;
public event EventHandler<CursorEventArgs> CursorPositionChanging;
public event EventHandler Customize;
public event EventHandler<CustomizeLegendEventArgs> CustomizeLegend;
public event EventHandler<FormatNumberEventArgs> FormatNumber;
public event EventHandler<ToolTipEventArgs> GetToolTipText;
public event EventHandler<ChartPaintEventArgs> PostPaint;
public event EventHandler<ChartPaintEventArgs> PrePaint;
public event EventHandler<CursorEventArgs> SelectionRangeChanged;
public event EventHandler<CursorEventArgs> SelectionRangeChanging;
#region Public Methods
[MonoTODO]
public void AlignDataPointsByAxisLabel ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public void AlignDataPointsByAxisLabel (PointSortOrder sortingOrder)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void AlignDataPointsByAxisLabel(string series)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void AlignDataPointsByAxisLabel (string series, PointSortOrder sortingOrder)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void ApplyPaletteColors ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public void BeginInit ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public void DataBind ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public void DataBindCrossTable (System.Collections.IEnumerable dataSource, string seriesGroupByField, string xField, string yFields, string otherFields)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void DataBindCrossTable (System.Collections.IEnumerable dataSource, string seriesGroupByField, string xField, string yFields, string otherFields, PointSortOrder sortingOrder)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void DataBindTable (System.Collections.IEnumerable dataSource)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void DataBindTable (System.Collections.IEnumerable dataSource, string xField)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void EndInit ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public HitTestResult HitTest (int x, int y)
{
throw new NotImplementedException ();
}
[MonoTODO]
public HitTestResult HitTest (int x, int y, bool ignoreTransparent)
{
throw new NotImplementedException ();
}
[MonoTODO]
public HitTestResult HitTest (int x, int y, ChartElementType requestedElement)
{
throw new NotImplementedException ();
}
[MonoTODO]
public HitTestResult[] HitTest (int x, int y, bool ignoreTransparent, params ChartElementType[] requestedElement)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void LoadTemplate (Stream stream)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void LoadTemplate (string name)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void ResetAutoValues ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public void SaveImage (Stream imageStream, ImageFormat format)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void SaveImage (Stream imageStream, ChartImageFormat format)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void SaveImage (string imageFileName, ImageFormat format)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void SaveImage (string imageFileName, ChartImageFormat format)
{
throw new NotImplementedException ();
}
#endregion
#region Protected Methods
protected override void Dispose (bool disposing)
{
}
#endregion
#region Private Methods
private void PaintElement (ChartGraphics g, object element, ElementPosition position)
{
ChartPaintEventArgs e = new ChartPaintEventArgs (this, element, g, position);
OnPrePaint (e);
OnPostPaint (e);
}
#endregion
}
}
|