#region License Information /* HeuristicLab * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using HeuristicLab.Core.Views; using HeuristicLab.MainForm; using HeuristicLab.Data; using System.Windows.Forms.DataVisualization.Charting; namespace HeuristicLab.Problems.TravelingSalesman.Views { [View("DoubleMatrix Heatmap View")] [Content(typeof(DoubleMatrix), false)] public partial class HeatmapView : ItemView { public new DoubleMatrix Content { get { return (DoubleMatrix)base.Content; } set { base.Content = value; } } public HeatmapView() { InitializeComponent(); chart.CustomizeAllChartAreas(); /* Series s = new Series(); DataPoint p = new DataPoint(0.4, 0.2); p.Color = Color.Red; p.MarkerStyle = MarkerStyle.None; p.MarkerSize = 10; s.Points.Add(p); DataPoint p2 = new DataPoint(0.6, 0.5); p2.Color = Color.Red; p2.MarkerStyle = MarkerStyle.None; p2.MarkerSize = 40; s.Points.Add(p2); DataPoint p3 = new DataPoint(0.8, 0.2); p3.Color = Color.Red; p3.MarkerStyle = MarkerStyle.None; p3.MarkerSize = 40; s.Points.Add(p3); DataPoint p4 = new DataPoint(0.7, 0.3); p4.Color = Color.Red; p4.MarkerStyle = MarkerStyle.None; p4.MarkerSize = 40; s.Points.Add(p4); s.ChartType = SeriesChartType.Area; s.XValueType = ChartValueType.String; s.YValueType = ChartValueType.Double; s.YAxisType = AxisType.Primary; chart.Series.Add(s); chart.Update();*/ } #region Chart Events protected virtual void chart_MouseDown(object sender, MouseEventArgs e) { HitTestResult result = chart.HitTest(e.X, e.Y); // } protected virtual void chart_MouseMove(object sender, MouseEventArgs e) { HitTestResult result = chart.HitTest(e.X, e.Y); if (result.ChartElementType == ChartElementType.LegendItem) this.Cursor = Cursors.Hand; else this.Cursor = Cursors.Default; } protected virtual void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) { foreach (LegendItem legendItem in e.LegendItems) { var series = chart.Series[legendItem.SeriesName]; // } } #endregion } }