Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs @ 8417

Last change on this file since 8417 was 8282, checked in by swagner, 12 years ago

Worked on enhanced version of ScatterPlot (#1892)

File size: 21.9 KB
RevLine 
[8280]1#region License Information
[7829]2/* HeuristicLab
3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
[8280]23using System.Collections.Generic;
[7829]24using System.Drawing;
[8280]25using System.Linq;
[7829]26using System.Windows.Forms;
[8280]27using System.Windows.Forms.DataVisualization.Charting;
[7829]28using HeuristicLab.Collections;
[8280]29using HeuristicLab.Common;
[7829]30using HeuristicLab.Core.Views;
31using HeuristicLab.MainForm;
32
33namespace HeuristicLab.Analysis.Views {
34  [View("ScatterPlot View")]
35  [Content(typeof(ScatterPlot), true)]
[8280]36  public partial class ScatterPlotView : NamedItemView, IConfigureableView {
37    protected List<Series> invisibleSeries;
38    protected Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow> pointsRowsTable;
39
[7829]40    public new ScatterPlot Content {
41      get { return (ScatterPlot)base.Content; }
42      set { base.Content = value; }
43    }
44
45    public ScatterPlotView() {
46      InitializeComponent();
[8280]47      pointsRowsTable = new Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow>();
48      invisibleSeries = new List<Series>();
[7829]49      chart.CustomizeAllChartAreas();
[8280]50      chart.ChartAreas[0].CursorX.Interval = 1;
[7829]51    }
52
[8280]53    #region Event Handler Registration
[7829]54    protected override void DeregisterContentEvents() {
[8280]55      foreach (ScatterPlotDataRow row in Content.Rows)
56        DeregisterScatterPlotDataRowEvents(row);
57      Content.VisualPropertiesChanged -= new EventHandler(Content_VisualPropertiesChanged);
58      Content.Rows.ItemsAdded -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded);
59      Content.Rows.ItemsRemoved -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsRemoved);
60      Content.Rows.ItemsReplaced -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsReplaced);
61      Content.Rows.CollectionReset -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset);
[7829]62      base.DeregisterContentEvents();
63    }
64    protected override void RegisterContentEvents() {
65      base.RegisterContentEvents();
[8280]66      Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged);
67      Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded);
68      Content.Rows.ItemsRemoved += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsRemoved);
69      Content.Rows.ItemsReplaced += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsReplaced);
70      Content.Rows.CollectionReset += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset);
[7829]71    }
72
[8280]73    protected virtual void RegisterScatterPlotDataRowEvents(ScatterPlotDataRow row) {
74      row.NameChanged += new EventHandler(Row_NameChanged);
75      row.VisualPropertiesChanged += new EventHandler(Row_VisualPropertiesChanged);
76      pointsRowsTable.Add(row.Points, row);
77      row.Points.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded);
78      row.Points.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved);
79      row.Points.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced);
80      row.Points.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset);
[7829]81    }
[8280]82    protected virtual void DeregisterScatterPlotDataRowEvents(ScatterPlotDataRow row) {
83      row.Points.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded);
84      row.Points.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved);
85      row.Points.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced);
86      row.Points.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset);
87      pointsRowsTable.Remove(row.Points);
88      row.VisualPropertiesChanged -= new EventHandler(Row_VisualPropertiesChanged);
89      row.NameChanged -= new EventHandler(Row_NameChanged);
90    }
91    #endregion
[7829]92
93    protected override void OnContentChanged() {
94      base.OnContentChanged();
[8280]95      invisibleSeries.Clear();
96      chart.Titles[0].Text = string.Empty;
97      chart.ChartAreas[0].AxisX.Title = string.Empty;
98      chart.ChartAreas[0].AxisY.Title = string.Empty;
99      chart.Series.Clear();
[7829]100      if (Content != null) {
[8280]101        chart.Titles[0].Text = Content.Name;
102        AddScatterPlotDataRows(Content.Rows);
103        ConfigureChartArea(chart.ChartAreas[0]);
104        RecalculateAxesScale(chart.ChartAreas[0]);
[7829]105      }
106    }
107
[8280]108    protected override void SetEnabledStateOfControls() {
109      base.SetEnabledStateOfControls();
110      chart.Enabled = Content != null;
[7829]111    }
112
[8280]113    public void ShowConfiguration() {
114      //if (Content != null) {
115      //  using (ScatterPlotVisualPropertiesDialog dialog = new ScatterPlotVisualPropertiesDialog(Content)) {
116      //    dialog.ShowDialog(this);
117      //  }
118      //} else MessageBox.Show("Nothing to configure.");
119    }
120    protected virtual void AddScatterPlotDataRows(IEnumerable<ScatterPlotDataRow> rows) {
121      foreach (var row in rows) {
122        RegisterScatterPlotDataRowEvents(row);
123        Series series = new Series(row.Name);
124        if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName;
125        else series.LegendText = row.Name;
126        ConfigureSeries(series, row);
127        FillSeriesWithRowValues(series, row);
128        chart.Series.Add(series);
129      }
130      ConfigureChartArea(chart.ChartAreas[0]);
131      RecalculateAxesScale(chart.ChartAreas[0]);
132      UpdateYCursorInterval();
133    }
134
135    protected virtual void RemoveScatterPlotDataRows(IEnumerable<ScatterPlotDataRow> rows) {
136      foreach (var row in rows) {
137        DeregisterScatterPlotDataRowEvents(row);
138        Series series = chart.Series[row.Name];
139        chart.Series.Remove(series);
140        if (invisibleSeries.Contains(series))
141          invisibleSeries.Remove(series);
142      }
143      RecalculateAxesScale(chart.ChartAreas[0]);
144    }
145
146    private void ConfigureSeries(Series series, ScatterPlotDataRow row) {
147      series.BorderWidth = 1;
148      series.BorderDashStyle = ChartDashStyle.Solid;
149      series.BorderColor = Color.Empty;
150
151      if (row.VisualProperties.Color != Color.Empty)
152        series.Color = row.VisualProperties.Color;
153      else series.Color = Color.Empty;
154      series.IsVisibleInLegend = row.VisualProperties.IsVisibleInLegend;
155      series.ChartType = SeriesChartType.FastPoint;
156      series.MarkerSize = row.VisualProperties.PointSize;
157      series.MarkerStyle = ConvertPointStyle(row.VisualProperties.PointStyle);
158      series.XAxisType = AxisType.Primary;
159      series.YAxisType = AxisType.Primary;
160
161      if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName;
162      else series.LegendText = row.Name;
163
164      string xAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.XAxisTitle)
165                      ? "X"
166                      : Content.VisualProperties.XAxisTitle;
167      string yAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.YAxisTitle)
168                            ? "Y"
169                            : Content.VisualProperties.YAxisTitle;
170      series.ToolTip =
171        series.LegendText + Environment.NewLine +
172        xAxisTitle + " = " + "#VALX," + Environment.NewLine +
173        yAxisTitle + " = " + "#VAL";
174    }
175
176    private void ConfigureChartArea(ChartArea area) {
177      if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont;
178      if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor;
179      chart.Titles[0].Text = Content.VisualProperties.Title;
180
181      if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont;
182      if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisX.TitleForeColor = Content.VisualProperties.AxisTitleColor;
183      area.AxisX.Title = Content.VisualProperties.XAxisTitle;
[8282]184      area.AxisX.MajorGrid.Enabled = Content.VisualProperties.XAxisGrid;
[8280]185
186      if (Content.VisualProperties.AxisTitleFont != null) area.AxisY.TitleFont = Content.VisualProperties.AxisTitleFont;
187      if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisY.TitleForeColor = Content.VisualProperties.AxisTitleColor;
188      area.AxisY.Title = Content.VisualProperties.YAxisTitle;
[8282]189      area.AxisY.MajorGrid.Enabled = Content.VisualProperties.YAxisGrid;
[8280]190    }
191
192    private void RecalculateAxesScale(ChartArea area) {
193      // Reset the axes bounds so that RecalculateAxesScale() will assign new bounds
194      foreach (Axis a in area.Axes) {
195        a.Minimum = double.NaN;
196        a.Maximum = double.NaN;
197      }
198      area.RecalculateAxesScale();
199      area.AxisX.IsMarginVisible = false;
200
201      if (!Content.VisualProperties.XAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue)) area.AxisX.Minimum = Content.VisualProperties.XAxisMinimumFixedValue;
202      if (!Content.VisualProperties.XAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue)) area.AxisX.Maximum = Content.VisualProperties.XAxisMaximumFixedValue;
203      if (!Content.VisualProperties.YAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.YAxisMinimumFixedValue)) area.AxisY.Minimum = Content.VisualProperties.YAxisMinimumFixedValue;
204      if (!Content.VisualProperties.YAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.YAxisMaximumFixedValue)) area.AxisY.Maximum = Content.VisualProperties.YAxisMaximumFixedValue;
205      if (area.AxisX.Minimum >= area.AxisX.Maximum) area.AxisX.Maximum = area.AxisX.Minimum + 1;
206      if (area.AxisY.Minimum >= area.AxisY.Maximum) area.AxisY.Maximum = area.AxisY.Minimum + 1;
207    }
208
209    protected virtual void UpdateYCursorInterval() {
210      double interestingValuesRange = (
211        from series in chart.Series
212        where series.Enabled
213        let values = (from point in series.Points
214                      where !point.IsEmpty
215                      select point.YValues[0]).DefaultIfEmpty(1.0)
216        let range = values.Max() - values.Min()
217        where range > 0.0
218        select range
219        ).DefaultIfEmpty(1.0).Min();
220
221      double digits = (int)Math.Log10(interestingValuesRange) - 3;
222      double yZoomInterval = Math.Pow(10, digits);
223      this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
224    }
225
226    #region Event Handlers
227    #region Content Event Handlers
228    protected override void Content_NameChanged(object sender, EventArgs e) {
229      if (InvokeRequired)
230        Invoke(new EventHandler(Content_NameChanged), sender, e);
231      else {
[7829]232        chart.Titles[0].Text = Content.Name;
[8280]233        base.Content_NameChanged(sender, e);
[7829]234      }
235    }
[8280]236    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
237      if (InvokeRequired)
238        Invoke(new EventHandler(Content_VisualPropertiesChanged), sender, e);
239      else {
240        ConfigureChartArea(chart.ChartAreas[0]);
241        RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed
242      }
243    }
244    #endregion
245    #region Rows Event Handlers
246    private void Rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
247      if (InvokeRequired)
248        Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded), sender, e);
249      else {
250        AddScatterPlotDataRows(e.Items);
251      }
252    }
253    private void Rows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
254      if (InvokeRequired)
255        Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsRemoved), sender, e);
256      else {
257        RemoveScatterPlotDataRows(e.Items);
258      }
259    }
260    private void Rows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
261      if (InvokeRequired)
262        Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsReplaced), sender, e);
263      else {
264        RemoveScatterPlotDataRows(e.OldItems);
265        AddScatterPlotDataRows(e.Items);
266      }
267    }
268    private void Rows_CollectionReset(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
269      if (InvokeRequired)
270        Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset), sender, e);
271      else {
272        RemoveScatterPlotDataRows(e.OldItems);
273        AddScatterPlotDataRows(e.Items);
274      }
275    }
276    #endregion
277    #region Row Event Handlers
278    private void Row_VisualPropertiesChanged(object sender, EventArgs e) {
279      if (InvokeRequired)
280        Invoke(new EventHandler(Row_VisualPropertiesChanged), sender, e);
281      else {
282        ScatterPlotDataRow row = (ScatterPlotDataRow)sender;
283        Series series = chart.Series[row.Name];
284        series.Points.Clear();
285        ConfigureSeries(series, row);
286        FillSeriesWithRowValues(series, row);
287        RecalculateAxesScale(chart.ChartAreas[0]);
288      }
289    }
290    private void Row_NameChanged(object sender, EventArgs e) {
291      if (InvokeRequired)
292        Invoke(new EventHandler(Row_NameChanged), sender, e);
293      else {
294        ScatterPlotDataRow row = (ScatterPlotDataRow)sender;
295        chart.Series[row.Name].Name = row.Name;
296      }
297    }
298    #endregion
299    #region Points Event Handlers
300    private void Points_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
301      if (InvokeRequired)
302        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded), sender, e);
303      else {
304        ScatterPlotDataRow row = null;
305        pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row);
306        if (row != null) {
307          Series rowSeries = chart.Series[row.Name];
308          if (!invisibleSeries.Contains(rowSeries)) {
309            rowSeries.Points.Clear();
310            FillSeriesWithRowValues(rowSeries, row);
311            RecalculateAxesScale(chart.ChartAreas[0]);
312            UpdateYCursorInterval();
313          }
314        }
315      }
316    }
317    private void Points_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
318      if (InvokeRequired)
319        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved), sender, e);
320      else {
321        ScatterPlotDataRow row = null;
322        pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row);
323        if (row != null) {
324          Series rowSeries = chart.Series[row.Name];
325          if (!invisibleSeries.Contains(rowSeries)) {
326            rowSeries.Points.Clear();
327            FillSeriesWithRowValues(rowSeries, row);
328            RecalculateAxesScale(chart.ChartAreas[0]);
329            UpdateYCursorInterval();
330          }
331        }
332      }
333    }
334    private void Points_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
335      if (InvokeRequired)
336        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced), sender, e);
337      else {
338        ScatterPlotDataRow row = null;
339        pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row);
340        if (row != null) {
341          Series rowSeries = chart.Series[row.Name];
342          if (!invisibleSeries.Contains(rowSeries)) {
343            rowSeries.Points.Clear();
344            FillSeriesWithRowValues(rowSeries, row);
345            RecalculateAxesScale(chart.ChartAreas[0]);
346            UpdateYCursorInterval();
347          }
348        }
349      }
350    }
351    private void Points_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
352      if (InvokeRequired)
353        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset), sender, e);
354      else {
355        ScatterPlotDataRow row = null;
356        pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row);
357        if (row != null) {
358          Series rowSeries = chart.Series[row.Name];
359          if (!invisibleSeries.Contains(rowSeries)) {
360            rowSeries.Points.Clear();
361            FillSeriesWithRowValues(rowSeries, row);
362            RecalculateAxesScale(chart.ChartAreas[0]);
363            UpdateYCursorInterval();
364          }
365        }
366      }
367    }
368    #endregion
369    #endregion
[7829]370
[8280]371    #region Chart Event Handlers
372    private void chart_MouseDown(object sender, MouseEventArgs e) {
373      HitTestResult result = chart.HitTest(e.X, e.Y);
374      if (result.ChartElementType == ChartElementType.LegendItem) {
375        ToggleSeriesVisible(result.Series);
[7829]376      }
377    }
[8280]378    private void chart_MouseMove(object sender, MouseEventArgs e) {
379      HitTestResult result = chart.HitTest(e.X, e.Y);
380      if (result.ChartElementType == ChartElementType.LegendItem)
381        this.Cursor = Cursors.Hand;
382      else
383        this.Cursor = Cursors.Default;
384    }
385    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
386      foreach (LegendItem legendItem in e.LegendItems) {
387        var series = chart.Series[legendItem.SeriesName];
388        if (series != null) {
389          bool seriesIsInvisible = invisibleSeries.Contains(series);
390          foreach (LegendCell cell in legendItem.Cells) {
391            cell.ForeColor = seriesIsInvisible ? Color.Gray : Color.Black;
392          }
393        }
394      }
395    }
396    #endregion
[7829]397
[8280]398    private void ToggleSeriesVisible(Series series) {
399      if (!invisibleSeries.Contains(series)) {
400        series.Points.Clear();
401        invisibleSeries.Add(series);
[7829]402      } else {
[8280]403        invisibleSeries.Remove(series);
404        if (Content != null) {
405
406          var row = (from r in Content.Rows
407                     where r.Name == series.Name
408                     select r).Single();
409          FillSeriesWithRowValues(series, row);
410          this.chart.Legends[series.Legend].ForeColor = Color.Black;
411          RecalculateAxesScale(chart.ChartAreas[0]);
412          UpdateYCursorInterval();
[7829]413        }
414      }
415    }
[8280]416
417    private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) {
418      for (int i = 0; i < row.Points.Count; i++) {
419        var value = row.Points[i];
420        DataPoint point = new DataPoint();
421        if (IsInvalidValue(value.X) || IsInvalidValue(value.Y))
422          point.IsEmpty = true;
423        else {
424          point.XValue = value.X;
425          point.YValues = new double[] { value.Y };
426        }
427        series.Points.Add(point);
428      }
429    }
430
431    #region Helpers
432    public static IEnumerable<double> DoubleRange(double min, double max, double step) {
433      double i;
434      for (i = min; i <= max; i += step)
435        yield return i;
436
437      if (i != max + step)
438        yield return i;
439    }
440
441    private double HumanRoundRange(double range) {
442      double base10 = Math.Pow(10.0, Math.Floor(Math.Log10(range)));
443      double rounding = range / base10;
444      if (rounding <= 1.5) rounding = 1;
445      else if (rounding <= 2.25) rounding = 2;
446      else if (rounding <= 3.75) rounding = 2.5;
447      else if (rounding <= 7.5) rounding = 5;
448      else rounding = 10;
449      return rounding * base10;
450    }
451
452    private double HumanRoundMax(double max) {
453      double base10;
454      if (max > 0) base10 = Math.Pow(10.0, Math.Floor(Math.Log10(max)));
455      else base10 = Math.Pow(10.0, Math.Ceiling(Math.Log10(-max)));
456      double rounding = (max > 0) ? base10 : -base10;
457      while (rounding < max) rounding += base10;
458      return rounding;
459    }
460
461    private MarkerStyle ConvertPointStyle(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle pointStyle) {
462      switch (pointStyle) {
463        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle:
464          return MarkerStyle.Circle;
465        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Cross:
466          return MarkerStyle.Cross;
467        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Diamond:
468          return MarkerStyle.Diamond;
469        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Square:
470          return MarkerStyle.Square;
471        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star4:
472          return MarkerStyle.Star4;
473        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star5:
474          return MarkerStyle.Star5;
475        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star6:
476          return MarkerStyle.Star6;
477        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star10:
478          return MarkerStyle.Star10;
479        case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Triangle:
480          return MarkerStyle.Triangle;
481        default:
482          return MarkerStyle.None;
483      }
484    }
485
486    protected static bool IsInvalidValue(double x) {
487      return double.IsNaN(x) || x < (double)decimal.MinValue || x > (double)decimal.MaxValue;
488    }
489    #endregion
[7829]490  }
491}
Note: See TracBrowser for help on using the repository browser.