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 DefaultSize; } }//FIXME
67 public Font Font { get; set; }
68 public override Color ForeColor { get; set; }
69 public NamedImagesCollection Images { get; private set;}
70 public bool IsSoftShadows { get; set; }
71 public LegendCollection Legends { get; private set; }
72 public ChartColorPalette Palette { get; set; }
73 public Color[] PaletteCustomColors { get; set; }
74 public PrintingManager Printing { get; private set;}
75 public double RenderingDpiX { get; set; }
76 public double RenderingDpiY { get; set; }
77 public ChartSerializer Serializer { get; private set; }
78 public SeriesCollection Series { get; private set; }
79 public Size Size { get; set; }
80 public bool SuppressExceptions { get; set; }
81 public TextAntiAliasingQuality TextAntiAliasingQuality { get; set; }
82 public TitleCollection Titles { get; private set;}
84 #region Protected Properties
85 protected override void OnPaint (PaintEventArgs e)
89 ChartGraphics g = new ChartGraphics (e.Graphics);
91 PaintElement (g, this, new ElementPosition (0, 0, 100, 100));
93 foreach (var area in ChartAreas)
94 PaintElement (g, area, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
96 foreach (var series in Series)
97 PaintElement (g, series, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
100 protected override void OnPaintBackground (PaintEventArgs pevent)
102 base.OnPaintBackground (pevent);
105 protected virtual void OnPostPaint (ChartPaintEventArgs e)
109 protected virtual void OnPrePaint (ChartPaintEventArgs e)
116 public event EventHandler AnnotationPlaced;
117 public event EventHandler AnnotationPositionChanged;
118 public event EventHandler<AnnotationPositionChangingEventArgs> AnnotationPositionChanging;
119 public event EventHandler AnnotationSelectionChanged;
120 public event EventHandler AnnotationTextChanged;
121 public event EventHandler<ScrollBarEventArgs> AxisScrollBarClicked;
122 public event EventHandler<ViewEventArgs> AxisViewChanged;
123 public event EventHandler<ViewEventArgs> AxisViewChanging;
124 public event EventHandler<CursorEventArgs> CursorPositionChanged;
125 public event EventHandler<CursorEventArgs> CursorPositionChanging;
126 public event EventHandler Customize;
127 public event EventHandler<CustomizeLegendEventArgs> CustomizeLegend;
128 public event EventHandler<FormatNumberEventArgs> FormatNumber;
129 public event EventHandler<ToolTipEventArgs> GetToolTipText;
130 public event EventHandler<ChartPaintEventArgs> PostPaint;
131 public event EventHandler<ChartPaintEventArgs> PrePaint;
132 public event EventHandler<CursorEventArgs> SelectionRangeChanged;
133 public event EventHandler<CursorEventArgs> SelectionRangeChanging;
136 #region Public Methods
139 public void AlignDataPointsByAxisLabel ()
141 throw new NotImplementedException ();
144 public void AlignDataPointsByAxisLabel (PointSortOrder sortingOrder)
146 throw new NotImplementedException ();
149 public void AlignDataPointsByAxisLabel(string series)
151 throw new NotImplementedException ();
154 public void AlignDataPointsByAxisLabel (string series, PointSortOrder sortingOrder)
156 throw new NotImplementedException ();
160 public void ApplyPaletteColors ()
162 throw new NotImplementedException ();
166 public void BeginInit ()
168 throw new NotImplementedException ();
172 public void DataBind ()
174 throw new NotImplementedException ();
178 public void DataBindCrossTable (System.Collections.IEnumerable dataSource, string seriesGroupByField, string xField, string yFields, string otherFields)
180 throw new NotImplementedException ();
183 public void DataBindCrossTable (System.Collections.IEnumerable dataSource, string seriesGroupByField, string xField, string yFields, string otherFields, PointSortOrder sortingOrder)
185 throw new NotImplementedException ();
189 public void DataBindTable (System.Collections.IEnumerable dataSource)
191 throw new NotImplementedException ();
194 public void DataBindTable (System.Collections.IEnumerable dataSource, string xField)
196 throw new NotImplementedException ();
200 public void EndInit ()
202 throw new NotImplementedException ();
206 public HitTestResult HitTest (int x, int y)
208 throw new NotImplementedException ();
212 public HitTestResult HitTest (int x, int y, bool ignoreTransparent)
214 throw new NotImplementedException ();
217 public HitTestResult HitTest (int x, int y, ChartElementType requestedElement)
219 throw new NotImplementedException ();
223 public HitTestResult[] HitTest (int x, int y, bool ignoreTransparent, params ChartElementType[] requestedElement)
225 throw new NotImplementedException ();
229 public void LoadTemplate (Stream stream)
231 throw new NotImplementedException ();
235 public void LoadTemplate (string name)
237 throw new NotImplementedException ();
241 public void ResetAutoValues ()
243 throw new NotImplementedException ();
247 public void SaveImage (Stream imageStream, ImageFormat format)
249 throw new NotImplementedException ();
252 public void SaveImage (Stream imageStream, ChartImageFormat format)
254 throw new NotImplementedException ();
257 public void SaveImage (string imageFileName, ImageFormat format)
259 throw new NotImplementedException ();
262 public void SaveImage (string imageFileName, ChartImageFormat format)
264 throw new NotImplementedException ();
268 #region Protected Methods
271 protected override void Dispose (bool disposing)
279 #region Private Methods
280 private void PaintElement (ChartGraphics g, object element, ElementPosition position)
282 ChartPaintEventArgs e = new ChartPaintEventArgs (this, element, g, position);