コード例 #1
0
        private void RunClusteringAndGraph()
        {
            if (chartDataSource != null)
            {
                Cluster cluster;

                distanceMetric = DistanceMetric(currentDistanceMatrix);

                try
                {
                    clusterResult = ClusterCalculate();
                }
                catch (InvalidOperationException)
                {
                    MessageBox.Show("Please try again.");
                    return;
                }


                /* Executing scatterplot */
                foreach (var dataPoint in chartDataSource)
                {
                    cluster = clusterResult.FindCluster(dataPoint.Origin);
                    if (cluster != null)
                    {
                        dataPoint.Group = string.Format("Cluster {0}", cluster.Id);
                    }
                }
                chartDataSource = chartDataSource.OrderBy(item => item.Group).ToList();

                scatterPlotControl1.BuildScatterPlot(chartDataSource);
            }
        }
コード例 #2
0
 private void outlierDetectionComponent1_DataPointClick(object sender, IdentifiableDataPoint e)
 {
     //DataPointClick(this, identifiableDataPoint);
     dataPointDetailsComponent1.GenerateDetails(e, clusterResult.FindCluster(e).Centroid);
     scatterPlotControl1.HighlightPoint(e);
 }