3 // Jonathan Pobst (monkey@jpobst.com)
4 // Francis Fisher (frankie@terrorise.me.uk)
6 // Copyright (C) 2009 Novell, Inc (http://www.novell.com)
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the
10 // "Software"), to deal in the Software without restriction, including
11 // without limitation the rights to use, copy, modify, merge, publish,
12 // distribute, sublicense, and/or sell copies of the Software, and to
13 // permit persons to whom the Software is furnished to do so, subject to
14 // the following conditions:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 using System.Drawing.Imaging;
31 using System.ComponentModel;
32 using System.Data.Common;
34 namespace System.Windows.Forms.DataVisualization.Charting
36 public class Chart : Control, ISupportInitialize, IDisposable
40 BackColor = Color.White;
41 ChartAreas = new ChartAreaCollection ();
42 Series = new SeriesCollection ();
44 public AnnotationCollection Annotations { get; private set;}
45 public AntiAliasingStyles AntiAliasing { get; set; }
46 public override Color BackColor { get; set; }
47 public GradientStyle BackGradientStyle { get; set; }
48 public override Image BackgroundImage { get; set; }
49 public ChartHatchStyle BackHatchStyle { get; set; }
50 public string BackImage { get; set; }
51 public ChartImageAlignmentStyle BackImageAlignment { get; set; }
52 public Color BackImageTransparentColor { get; set; }
53 public ChartImageWrapMode BackImageWrapMode { get; set; }
54 public Color BackSecondaryColor { get; set; }
55 public Color BorderColor { get; set; }
56 public ChartDashStyle BorderDashStyle { get; set; }
57 public Color BorderlineColor { get; set; }
58 public ChartDashStyle BorderlineDashStyle { get; set; }
59 public int BorderlineWidth { get; set; }
60 public BorderSkin BorderSkin { get; set; }
61 public int BorderWidth { get; set; }
62 public string BuildNumber { get; private set;}
63 public ChartAreaCollection ChartAreas { get; private set; }
64 public DataManipulator DataManipulator { get; private set;}
65 public Object DataSource { get; set; }
66 protected override Size DefaultSize { get { return base.DefaultSize; } }//FIXME
67 public override Color ForeColor { get; set; }
68 public NamedImagesCollection Images { get; private set;}
69 public bool IsSoftShadows { get; set; }
70 public LegendCollection Legends { get; private set; }
71 public ChartColorPalette Palette { get; set; }
72 public Color[] PaletteCustomColors { get; set; }
73 public PrintingManager Printing { get; private set;}
74 public double RenderingDpiX { get; set; }
75 public double RenderingDpiY { get; set; }
76 public ChartSerializer Serializer { get; private set; }
77 public SeriesCollection Series { get; private set; }
78 public bool SuppressExceptions { get; set; }
79 public TextAntiAliasingQuality TextAntiAliasingQuality { get; set; }
80 public TitleCollection Titles { get; private set;}
82 #region Protected Properties
83 protected override void OnPaint (PaintEventArgs e)
87 ChartGraphics g = new ChartGraphics (e.Graphics);
89 PaintElement (g, this, new ElementPosition (0, 0, 100, 100));
91 foreach (var area in ChartAreas)
92 PaintElement (g, area, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
94 foreach (var series in Series)
95 PaintElement (g, series, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
98 protected override void OnPaintBackground (PaintEventArgs pevent)
100 base.OnPaintBackground (pevent);
103 protected virtual void OnPostPaint (ChartPaintEventArgs e)
107 protected virtual void OnPrePaint (ChartPaintEventArgs e)
114 public event EventHandler AnnotationPlaced;
115 public event EventHandler AnnotationPositionChanged;
116 public event EventHandler<AnnotationPositionChangingEventArgs> AnnotationPositionChanging;
117 public event EventHandler AnnotationSelectionChanged;
118 public event EventHandler AnnotationTextChanged;
119 public event EventHandler<ScrollBarEventArgs> AxisScrollBarClicked;
120 public event EventHandler<ViewEventArgs> AxisViewChanged;
121 public event EventHandler<ViewEventArgs> AxisViewChanging;
122 public event EventHandler<CursorEventArgs> CursorPositionChanged;
123 public event EventHandler<CursorEventArgs> CursorPositionChanging;
124 public event EventHandler Customize;
125 public event EventHandler<CustomizeLegendEventArgs> CustomizeLegend;
126 public event EventHandler<FormatNumberEventArgs> FormatNumber;
127 public event EventHandler<ToolTipEventArgs> GetToolTipText;
128 public event EventHandler<ChartPaintEventArgs> PostPaint;
129 public event EventHandler<ChartPaintEventArgs> PrePaint;
130 public event EventHandler<CursorEventArgs> SelectionRangeChanged;
131 public event EventHandler<CursorEventArgs> SelectionRangeChanging;
134 #region Public Methods
137 public void AlignDataPointsByAxisLabel ()
139 throw new NotImplementedException ();
142 public void AlignDataPointsByAxisLabel (PointSortOrder sortingOrder)
144 throw new NotImplementedException ();
147 public void AlignDataPointsByAxisLabel(string series)
149 throw new NotImplementedException ();
152 public void AlignDataPointsByAxisLabel (string series, PointSortOrder sortingOrder)
154 throw new NotImplementedException ();
158 public void ApplyPaletteColors ()
160 throw new NotImplementedException ();
164 public void BeginInit ()
166 throw new NotImplementedException ();
170 public void DataBind ()
172 throw new NotImplementedException ();
176 public void DataBindCrossTable (System.Collections.IEnumerable dataSource, string seriesGroupByField, string xField, string yFields, string otherFields)
178 throw new NotImplementedException ();
181 public void DataBindCrossTable (System.Collections.IEnumerable dataSource, string seriesGroupByField, string xField, string yFields, string otherFields, PointSortOrder sortingOrder)
183 throw new NotImplementedException ();
187 public void DataBindTable (System.Collections.IEnumerable dataSource)
189 throw new NotImplementedException ();
192 public void DataBindTable (System.Collections.IEnumerable dataSource, string xField)
194 throw new NotImplementedException ();
198 public void EndInit ()
200 throw new NotImplementedException ();
204 public HitTestResult HitTest (int x, int y)
206 throw new NotImplementedException ();
210 public HitTestResult HitTest (int x, int y, bool ignoreTransparent)
212 throw new NotImplementedException ();
215 public HitTestResult HitTest (int x, int y, ChartElementType requestedElement)
217 throw new NotImplementedException ();
221 public HitTestResult[] HitTest (int x, int y, bool ignoreTransparent, params ChartElementType[] requestedElement)
223 throw new NotImplementedException ();
227 public void LoadTemplate (Stream stream)
229 throw new NotImplementedException ();
233 public void LoadTemplate (string name)
235 throw new NotImplementedException ();
239 public void ResetAutoValues ()
241 throw new NotImplementedException ();
245 public void SaveImage (Stream imageStream, ImageFormat format)
247 throw new NotImplementedException ();
250 public void SaveImage (Stream imageStream, ChartImageFormat format)
252 throw new NotImplementedException ();
255 public void SaveImage (string imageFileName, ImageFormat format)
257 throw new NotImplementedException ();
260 public void SaveImage (string imageFileName, ChartImageFormat format)
262 throw new NotImplementedException ();
266 #region Protected Methods
269 protected override void Dispose (bool disposing)
277 #region Private Methods
278 private void PaintElement (ChartGraphics g, object element, ElementPosition position)
280 ChartPaintEventArgs e = new ChartPaintEventArgs (this, element, g, position);