Esempio n. 1
0
 // protected Size SizeHisto = new System.Drawing.Size(10, 5);
 public cWell(cWell NewWell)
 {
     this.PosX = NewWell.PosX;
     this.PosY = NewWell.PosY;
     this.ListDescriptors = NewWell.ListDescriptors;
     this.Parent = NewWell.Parent;
     this.AssociatedChart = NewWell.AssociatedChart;
     this.AssociatedPlate = NewWell.AssociatedPlate;
     this.CurrentColor = this.Parent.GlobalInfo.GetColor(ClassForClassif);
 }
Esempio n. 2
0
        public PlateChart BuildChartForClass()
        {
            if (AssociatedChart != null) AssociatedChart.Dispose();
            AssociatedChart = new PlateChart();
            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].LabelStyle.Enabled = false;

            CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
            CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
            CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;

            CurrentChartArea.BackColor = CurrentColor; //Color.FromArgb(LUT[0][ConvertedValue], LUT[1][ConvertedValue], LUT[2][ConvertedValue]);
            AssociatedChart.ChartAreas.Add(CurrentChartArea);
            //AssociatedChart.Location = new System.Drawing.Point((PosX - 1) * (Parent.SizeHistoWidth + Parent.GutterSize), (PosY - 1) * (Parent.SizeHistoHeight + Parent.GutterSize));
            //AssociatedChart.Series.Add(CurrentSeries);

            int GutterSize = (int)Parent.GlobalInfo.OptionsWindow.numericUpDownGutter.Value;

            AssociatedChart.Location = new System.Drawing.Point((int)((PosX - 1) * (Parent.GlobalInfo.SizeHistoWidth + GutterSize) + Parent.GlobalInfo.ShiftX), (int)((PosY - 1) * (Parent.GlobalInfo.SizeHistoHeight + GutterSize) + Parent.GlobalInfo.ShiftY));
            AssociatedChart.Series.Add(CurrentSeries);

            AssociatedChart.BackColor = CurrentColor;
            AssociatedChart.Width = (int)Parent.GlobalInfo.SizeHistoWidth;
            AssociatedChart.Height = (int)Parent.GlobalInfo.SizeHistoHeight;

            if (Parent.GlobalInfo.OptionsWindow.checkBoxDisplayWellInformation.Checked)
            {
                Title MainLegend = new Title();

                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoName.Checked)
                    MainLegend.Text = Name;
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoInfo.Checked)
                    MainLegend.Text = Info;
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoLocusID.Checked)
                    MainLegend.Text = ((int)(LocusID)).ToString();
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoConcentration.Checked)
                {
                    if(Concentration>=0)
                    MainLegend.Text = Concentration.ToString("e4");
                }

                MainLegend.Docking = Docking.Bottom;
                MainLegend.Font = new System.Drawing.Font("Arial", Parent.GlobalInfo.SizeHistoWidth / 10 + 1, FontStyle.Regular);
                MainLegend.BackColor = MainLegend.BackImageTransparentColor;

                AssociatedChart.Titles.Add(MainLegend);
            }
            AssociatedChart.Update();
            AssociatedChart.Show();
            AssociatedChart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.AssociatedChart_MouseClick);
            AssociatedChart.GetToolTipText += new System.EventHandler<ToolTipEventArgs>(this.AssociatedChart_GetToolTipText);
            return this.AssociatedChart;
        }
Esempio n. 3
0
        public PlateChart BuildChart(int IdxDescriptor, double[] MinMax)
        {
            if (Parent.GlobalInfo.IsDisplayClassOnly) return BuildChartForClass();

            int borderSize = 8;
            int GutterSize = (int)Parent.GlobalInfo.OptionsWindow.numericUpDownGutter.Value;

            if (AssociatedChart != null) AssociatedChart.Dispose();
            if (IdxDescriptor >= ListDescriptors.Count) return null;
            CurrentDescriptorToDisplay = IdxDescriptor;
            AssociatedChart = new PlateChart();
            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].LabelStyle.Enabled = false;

            if ((ListDescriptors[IdxDescriptor].GetAssociatedType().GetBinNumber() == 1) || (Parent.GlobalInfo.OptionsWindow.radioButtonDisplayAverage.Checked))
            {
                CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
                CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;

                int ConvertedValue;

                byte[][] LUT = Parent.GlobalInfo.LUT_JET;

                if (MinMax[0] == MinMax[1])
                    ConvertedValue = 0;
                else
                    ConvertedValue = (int)(((ListDescriptors[IdxDescriptor].GetValue() - MinMax[0]) * (LUT[0].Length - 1)) / (MinMax[1] - MinMax[0]));
                if ((ConvertedValue >= 0) && (ConvertedValue < LUT[0].Length))
                    CurrentChartArea.BackColor = Color.FromArgb(LUT[0][ConvertedValue], LUT[1][ConvertedValue], LUT[2][ConvertedValue]);
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }
            else
            {
                CurrentSeries.ChartType = SeriesChartType.Line;
                for (int IdxValue = 0; IdxValue < ListDescriptors[IdxDescriptor].GetAssociatedType().GetBinNumber(); IdxValue++)
                    CurrentSeries.Points.Add(ListDescriptors[IdxDescriptor].Getvalue(IdxValue));

                CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[1].MajorGrid.LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                CurrentChartArea.Axes[0].LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[0].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                CurrentSeries.Color = Color.White;
                CurrentSeries.BorderWidth = 1;
                CurrentChartArea.BackColor = Color.FromArgb(16, 37, 63);

                CurrentChartArea.BorderWidth = borderSize;
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }

            AssociatedChart.Location = new System.Drawing.Point((int)((PosX - 1) * (Parent.GlobalInfo.SizeHistoWidth + GutterSize) + Parent.GlobalInfo.ShiftX), (int)((PosY - 1) * (Parent.GlobalInfo.SizeHistoHeight + GutterSize) + Parent.GlobalInfo.ShiftY));
            AssociatedChart.Series.Add(CurrentSeries);

            AssociatedChart.BackColor = CurrentColor;
            AssociatedChart.Width = (int)Parent.GlobalInfo.SizeHistoWidth;
            AssociatedChart.Height = (int)Parent.GlobalInfo.SizeHistoHeight;

            if (Parent.GlobalInfo.OptionsWindow.checkBoxDisplayWellInformation.Checked)
            {
                Title MainLegend = new Title();

                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoName.Checked)
                    MainLegend.Text = Name;
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoInfo.Checked)
                    MainLegend.Text = Info;
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoLocusID.Checked)
                    MainLegend.Text = ((int)(LocusID)).ToString();
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoConcentration.Checked)
                    if(Concentration>=0) MainLegend.Text = Concentration.ToString("e4");

                MainLegend.Docking = Docking.Bottom;
                MainLegend.Font = new System.Drawing.Font("Arial", Parent.GlobalInfo.SizeHistoWidth / 10 + 1, FontStyle.Regular);
                MainLegend.BackColor = MainLegend.BackImageTransparentColor;

                AssociatedChart.Titles.Add(MainLegend);
            }
            AssociatedChart.Update();
            AssociatedChart.Show();
            AssociatedChart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.AssociatedChart_MouseClick);
            AssociatedChart.GetToolTipText += new System.EventHandler<ToolTipEventArgs>(this.AssociatedChart_GetToolTipText);
            return this.AssociatedChart;
        }
Esempio n. 4
0
        public PlateChart BuildChartForClass()
        {
            if (AssociatedChart != null) AssociatedChart.Dispose();
            AssociatedChart = new PlateChart();

            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].LabelStyle.Enabled = false;

            CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
            CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
            CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;

            CurrentChartArea.BackColor = this.GetClassColor();// cGlobalInfo.ListClasses[this.ClassForClassif].ColourForDisplay;// CurrentColor; //Color.FromArgb(LUT[0][ConvertedValue], LUT[1][ConvertedValue], LUT[2][ConvertedValue]);
            AssociatedChart.ChartAreas.Add(CurrentChartArea);
            //AssociatedChart.Location = new System.Drawing.Point((PosX - 1) * (cGlobalInfo.CurrentScreening.SizeHistoWidth + cGlobalInfo.CurrentScreening.GutterSize), (PosY - 1) * (cGlobalInfo.CurrentScreening.SizeHistoHeight + cGlobalInfo.CurrentScreening.GutterSize));
            //AssociatedChart.Series.Add(CurrentSeries);

            int GutterSize = (int)cGlobalInfo.OptionsWindow.FFAllOptions.numericUpDownGutter.Value;

            AssociatedChart.Location = new System.Drawing.Point(
                                        (int)((PosX - 1) * (cGlobalInfo.SizeHistoWidth + GutterSize) + cGlobalInfo.SizeHistoWidth),
                                        (int)((PosY - 1) * (cGlobalInfo.SizeHistoHeight + GutterSize) + cGlobalInfo.SizeHistoHeight));
            AssociatedChart.Series.Add(CurrentSeries);

            AssociatedChart.BackColor = this.GetClassColor();//cGlobalInfo.ListClasses[this.ClassForClassif].ColourForDisplay;// CurrentColor;
            AssociatedChart.Width = (int)cGlobalInfo.SizeHistoWidth;
            AssociatedChart.Height = (int)cGlobalInfo.SizeHistoHeight;

            cPropertyType WellPropertyType = null;
            foreach (object item in cGlobalInfo.WindowHCSAnalyzer.toolStripDropDownButtonDisplayMode.DropDownItems)
            {

                if (item.GetType() == typeof(ToolStripMenuItem))
                {
                    ToolStripMenuItem TmpMenuItem = ((ToolStripMenuItem)item);

                    if (TmpMenuItem.Checked && (TmpMenuItem.Tag != null) && (TmpMenuItem.Tag.GetType() == typeof(cPropertyType)))
                    {
                        WellPropertyType = ((cPropertyType)(TmpMenuItem).Tag);
                        break;
                    }
                }
            }

            if ((WellPropertyType != null) && (cGlobalInfo.ViewMode != eViewMode.PIE))
            {
                Title MainLegend = new Title();

                if (WellPropertyType != null)
                {
                    object CurrentValue = this.ListProperties.FindValueByName(WellPropertyType.Name);
                    if (CurrentValue != null)
                    {

                        if (WellPropertyType.Name == "Well Class")
                        {
                            if((int)CurrentValue==-1)
                            MainLegend.Text = "n.a.";
                            else
                            MainLegend.Text = cGlobalInfo.ListWellClasses[(int)CurrentValue].Name;
                        }
                        else
                            MainLegend.Text = CurrentValue.ToString();
                    }
                    else
                        MainLegend.Text = "n.a.";

                }
                MainLegend.Docking = Docking.Bottom;
                MainLegend.Font = new System.Drawing.Font("Arial", cGlobalInfo.SizeHistoWidth / 10 + 1, FontStyle.Regular);
                MainLegend.BackColor = MainLegend.BackImageTransparentColor;
                MainLegend.ForeColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFontColor.BackColor;
                AssociatedChart.Titles.Add(MainLegend);
            }

               // AssociatedChart.Update();
               // AssociatedChart.Show();
            AssociatedChart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.AssociatedChart_MouseClick);
            AssociatedChart.MouseDown += new MouseEventHandler(AssociatedChart_MouseDown);

            AssociatedChart.DragDrop += new DragEventHandler(AssociatedChart_DragDrop);
            AssociatedChart.DragEnter += new DragEventHandler(AssociatedChart_DragEnter);
            AssociatedChart.AllowDrop = true;

            AssociatedChart.GetToolTipText += new System.EventHandler<ToolTipEventArgs>(this.AssociatedChart_GetToolTipText);

            return AssociatedChart;
        }
Esempio n. 5
0
        public PlateChart BuildChart(int IdxDescriptor, double[] MinMax)
        {
            if (cGlobalInfo.IsDisplayClassOnly) return BuildChartForClass();

            cPropertyType WellPropertyType = null;

            ToolStripMenuItem CheckedMenuItem = null;

            foreach (object item in cGlobalInfo.WindowHCSAnalyzer.toolStripDropDownButtonDisplayMode.DropDownItems)
            {

                if (item.GetType() == typeof(ToolStripMenuItem))
                {
                    ToolStripMenuItem TmpMenuItem = ((ToolStripMenuItem)item);

                    if (TmpMenuItem.Checked)
                    {
                        CheckedMenuItem = TmpMenuItem;
                        if ((TmpMenuItem.Tag != null) && (TmpMenuItem.Tag.GetType() == typeof(cPropertyType)))
                        {
                            WellPropertyType = ((cPropertyType)(TmpMenuItem).Tag);
                            break;
                        }
                    }
                }
            }

            int borderSize = 8;
            int GutterSize = (int)cGlobalInfo.OptionsWindow.FFAllOptions.numericUpDownGutter.Value;

            if (AssociatedChart != null) AssociatedChart.Dispose();
            if (IdxDescriptor >= ListSignatures.Count) return null;
            CurrentDescriptorToDisplay = IdxDescriptor;
            AssociatedChart = new PlateChart();
            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].LabelStyle.Enabled = false;

            #region Pie
            if (cGlobalInfo.ViewMode == eViewMode.PIE)
            {
                CurrentSeries.ChartType = SeriesChartType.Pie;
                int RealIdx = 0;

                for (int IdxValue = 0; IdxValue < ListSignatures.Count; IdxValue++)
                {
                    if (ListSignatures[IdxValue].GetAssociatedType().IsActive())
                    {
                        CurrentSeries.Points.Add(ListSignatures[IdxValue].GetValue());
                        CurrentSeries.Points[CurrentSeries.Points.Count - 1].Color = cGlobalInfo.ListCellularPhenotypes[RealIdx++ % cGlobalInfo.ListCellularPhenotypes.Count].ColourForDisplay;
                    }
                }
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }
            #endregion

            #region Average
            else if ((ListSignatures[IdxDescriptor].GetAssociatedType().GetBinNumber() == 1) || (cGlobalInfo.ViewMode == eViewMode.AVERAGE))
            {
                CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
                CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;

                //int ConvertedValue;

                //byte[][] LUT = cGlobalInfo.LUT;

                //if (MinMax[0] == MinMax[1])
                //    ConvertedValue = 0;
                //else
                //    ConvertedValue = (int)(((ListSignatures[IdxDescriptor].GetValue() - MinMax[0]) * (LUT[0].Length - 1)) / (MinMax[1] - MinMax[0]));

                //if ((ConvertedValue >= 0) && (ConvertedValue < LUT[0].Length))
                //    CurrentChartArea.BackColor = Color.FromArgb(LUT[0][ConvertedValue], LUT[1][ConvertedValue], LUT[2][ConvertedValue]);

                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }
            #endregion

            #region Histogram
            else
            {
                CurrentSeries.ChartType = SeriesChartType.Column;

                int HistoSize = ListSignatures[IdxDescriptor].GetHistovalues().Count;
                for (int IdxValue = 0; IdxValue < /* ListDescriptors[IdxDescriptor].GetAssociatedType().GetBinNumber()*/ HistoSize; IdxValue++)
                {
                    if ((cGlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked) || (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked))
                        CurrentSeries.Points.AddXY(ListSignatures[IdxDescriptor].GetHistoXvalue(IdxValue), ListSignatures[IdxDescriptor].GetHistovalue(IdxValue));
                    else
                        CurrentSeries.Points.Add(ListSignatures[IdxDescriptor].GetHistovalue(IdxValue));
                }

                CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[1].MajorGrid.LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                CurrentChartArea.Axes[0].LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[0].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                if (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked)
                {
                    CurrentChartArea.Axes[0].Minimum = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().MinMaxHisto[0];
                    CurrentChartArea.Axes[0].Maximum = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().MinMaxHisto[1];
                }
                else if (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked)
                {
                    CurrentChartArea.Axes[0].Minimum = (double)cGlobalInfo.OptionsWindow.numericUpDownManualMin.Value;
                    CurrentChartArea.Axes[0].Maximum = (double)cGlobalInfo.OptionsWindow.numericUpDownManualMax.Value;
                }
                CurrentSeries.Color = Color.White;
                CurrentSeries.BorderWidth = 1;
                CurrentChartArea.BorderWidth = borderSize;
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }
            #endregion

            AssociatedChart.Location = new System.Drawing.Point(
                                        (int)((PosX - 1) * (cGlobalInfo.SizeHistoWidth + GutterSize) + cGlobalInfo.SizeHistoWidth),
                                        (int)((PosY - 1) * (cGlobalInfo.SizeHistoHeight + GutterSize) + cGlobalInfo.SizeHistoHeight));

            AssociatedChart.Series.Add(CurrentSeries);
            AssociatedChart.BackColor = this.GetClassColor();
            AssociatedChart.Width = (int)cGlobalInfo.SizeHistoWidth;
            AssociatedChart.Height = (int)cGlobalInfo.SizeHistoHeight;

            if ((CheckedMenuItem != null) && (cGlobalInfo.ViewMode != eViewMode.PIE))
            {
                Title MainLegend = new Title();

                if (WellPropertyType != null)
                {
                    object CurrentValue = this.ListProperties.FindValueByName(WellPropertyType.Name);

                    if (CurrentValue != null)
                    {

                        if (WellPropertyType.Name == "Well Class")
                        {
                           if (((int)CurrentValue<cGlobalInfo.ListWellClasses.Count) && ((int)CurrentValue >= 0))
                                MainLegend.Text = cGlobalInfo.ListWellClasses[(int)CurrentValue].Name;
                           else
                               MainLegend.Text = "n.a.";

                        }
                        else
                            MainLegend.Text = CurrentValue.ToString();
                    }
                    else
                        MainLegend.Text = "n.a.";

                    MainLegend.Docking = Docking.Bottom;
                    MainLegend.Font = new System.Drawing.Font("Arial", cGlobalInfo.SizeHistoWidth / 10 + 1, FontStyle.Bold);
                    MainLegend.ForeColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFontColor.BackColor;
                    AssociatedChart.Titles.Add(MainLegend);

                }
                else if (CheckedMenuItem.Text == "Current Descriptor Value")
                {
                    MainLegend.Text = this.GetAverageValue(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()).ToString("N3");

                    MainLegend.Docking = Docking.Bottom;
                    MainLegend.Font = new System.Drawing.Font("Arial", cGlobalInfo.SizeHistoWidth / 10 + 1, FontStyle.Regular);
                    AssociatedChart.Titles.Add(MainLegend);
                }
            }

            //AssociatedChart.Update();
            //AssociatedChart.Show();
            AssociatedChart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.AssociatedChart_MouseClick);
            AssociatedChart.MouseDown += new MouseEventHandler(AssociatedChart_MouseDown);
            AssociatedChart.AllowDrop = true;
            AssociatedChart.DragDrop += new DragEventHandler(AssociatedChart_DragDrop);
            AssociatedChart.DragEnter += new DragEventHandler(AssociatedChart_DragEnter);

            AssociatedChart.GetToolTipText += new System.EventHandler<ToolTipEventArgs>(this.AssociatedChart_GetToolTipText);

            return this.AssociatedChart;
        }
Esempio n. 6
0
        public PlateChart BuildChart(int IdxDescriptor, double[] MinMax)
        {
            if (Parent.GlobalInfo.IsDisplayClassOnly) return BuildChartForClass();

            int borderSize = 8;
            int GutterSize = (int)Parent.GlobalInfo.OptionsWindow.numericUpDownGutter.Value;

            if (AssociatedChart != null) AssociatedChart.Dispose();
            if (IdxDescriptor >= ListDescriptors.Count) return null;
            CurrentDescriptorToDisplay = IdxDescriptor;
            AssociatedChart = new PlateChart();
            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].LabelStyle.Enabled = false;

            if (Parent.GlobalInfo.ViewMode == eViewMode.PIE)
            {
                CurrentSeries.ChartType = SeriesChartType.Pie;
                //AssociatedChart.Palette = ChartColorPalette.Grayscale;
                //ChartColorPalette a = new ChartColorPalette();

                for (int IdxValue = 0; IdxValue < ListDescriptors.Count; IdxValue++)
                {
                    if (ListDescriptors[IdxValue].GetAssociatedType().IsActive())
                    {
                        CurrentSeries.Points.Add(ListDescriptors[IdxValue].GetValue());
                        //CurrentSeries.Points[Idx].Label = String.Format("{0:0.###}", ((100.0 * ListPathway[Idx].Occurence) / TotalOcurrence)) + " %";

                        //CurrentSeries.Points[Idx].LegendText = ListPathway[Idx].Name;
                        //CurrentSeries.Points[CurrentSeries.Points.Count - 1] = 2;
                        //CurrentSeries.Points[CurrentSeries.Points.Count - 1].Label = ListDescriptors[IdxValue].GetAssociatedType().GetName() + " : ";
                    }
                }
                //CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                //CurrentChartArea.Axes[1].MajorGrid.LineColor = Color.FromArgb(127, 127, 127);
                //CurrentChartArea.Axes[1].LineColor = Color.FromArgb(127, 127, 127);
                //CurrentChartArea.Axes[1].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                //CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                //CurrentChartArea.Axes[0].LineColor = Color.FromArgb(127, 127, 127);
                //CurrentChartArea.Axes[0].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                //CurrentSeries.Color = Color.White;
                //CurrentSeries.BorderWidth = 1;
                //CurrentChartArea.BackColor = Color.FromArgb(16, 37, 63);

                //CurrentChartArea.BorderWidth = borderSize;
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }
            else if ((ListDescriptors[IdxDescriptor].GetAssociatedType().GetBinNumber() == 1) || (Parent.GlobalInfo.ViewMode == eViewMode.AVERAGE))
            {
                CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
                CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;

                int ConvertedValue;

                byte[][] LUT = Parent.GlobalInfo.LUT;

                if (MinMax[0] == MinMax[1])
                    ConvertedValue = 0;
                else
                    ConvertedValue = (int)(((ListDescriptors[IdxDescriptor].GetValue() - MinMax[0]) * (LUT[0].Length - 1)) / (MinMax[1] - MinMax[0]));
                if ((ConvertedValue >= 0) && (ConvertedValue < LUT[0].Length))
                    CurrentChartArea.BackColor = Color.FromArgb(LUT[0][ConvertedValue], LUT[1][ConvertedValue], LUT[2][ConvertedValue]);
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }
            else
            {
                CurrentSeries.ChartType = SeriesChartType.Column;

                for (int IdxValue = 0; IdxValue < ListDescriptors[IdxDescriptor].Histogram.GetXvalues().Count; IdxValue++)
                {
                    if ((Parent.GlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked) || (Parent.GlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked))
                    {
                        CurrentSeries.Points.AddXY(ListDescriptors[IdxDescriptor].GetHistoXvalue(IdxValue), ListDescriptors[IdxDescriptor].GetHistovalue(IdxValue));
                    }
                    else
                    {
                        CurrentSeries.Points.Add(ListDescriptors[IdxDescriptor].GetHistovalue(IdxValue));
                    }
                }

                CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
                CurrentChartArea.Axes[1].MajorGrid.LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
                CurrentChartArea.Axes[0].LineColor = Color.FromArgb(127, 127, 127);
                CurrentChartArea.Axes[0].MajorTickMark.LineColor = Color.FromArgb(127, 127, 127);
                if (Parent.GlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked)
                {
                    CurrentChartArea.Axes[0].Minimum = Parent.GetCurrentDisplayPlate().MinMaxHisto[0];
                    CurrentChartArea.Axes[0].Maximum = Parent.GetCurrentDisplayPlate().MinMaxHisto[1];
                }
                else if (Parent.GlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked)
                {
                    CurrentChartArea.Axes[0].Minimum = (double)Parent.GlobalInfo.OptionsWindow.numericUpDownManualMin.Value;
                    CurrentChartArea.Axes[0].Maximum = (double)Parent.GlobalInfo.OptionsWindow.numericUpDownManualMax.Value;
                }
                CurrentSeries.Color = Color.White;
                CurrentSeries.BorderWidth = 1;
                CurrentChartArea.BackColor = Color.FromArgb(16, 37, 63);

                CurrentChartArea.BorderWidth = borderSize;
                AssociatedChart.ChartAreas.Add(CurrentChartArea);
            }

            AssociatedChart.Location = new System.Drawing.Point((int)((PosX - 1) * (Parent.GlobalInfo.SizeHistoWidth + GutterSize) + Parent.GlobalInfo.ShiftX), (int)((PosY - 1) * (Parent.GlobalInfo.SizeHistoHeight + GutterSize) + Parent.GlobalInfo.ShiftY));
            AssociatedChart.Series.Add(CurrentSeries);

            AssociatedChart.BackColor = CurrentColor;
            AssociatedChart.Width = (int)Parent.GlobalInfo.SizeHistoWidth;
            AssociatedChart.Height = (int)Parent.GlobalInfo.SizeHistoHeight;

            if ((Parent.GlobalInfo.OptionsWindow.checkBoxDisplayWellInformation.Checked) && (Parent.GlobalInfo.ViewMode != eViewMode.PIE))
            {
                Title MainLegend = new Title();

                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoName.Checked)
                    MainLegend.Text = Name;
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoInfo.Checked)
                    MainLegend.Text = Info;
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoDescValue.Checked)
                    MainLegend.Text = ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue().ToString("N3");
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoLocusID.Checked)
                    MainLegend.Text = ((int)(LocusID)).ToString();
                if (Parent.GlobalInfo.OptionsWindow.radioButtonWellInfoConcentration.Checked)
                    if (Concentration >= 0) MainLegend.Text = Concentration.ToString("e4");

                MainLegend.Docking = Docking.Bottom;
                MainLegend.Font = new System.Drawing.Font("Arial", Parent.GlobalInfo.SizeHistoWidth / 10 + 1, FontStyle.Regular);
                MainLegend.BackColor = MainLegend.BackImageTransparentColor;

                AssociatedChart.Titles.Add(MainLegend);
            }
            AssociatedChart.Update();
            AssociatedChart.Show();
            AssociatedChart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.AssociatedChart_MouseClick);
            AssociatedChart.GetToolTipText += new System.EventHandler<ToolTipEventArgs>(this.AssociatedChart_GetToolTipText);
            return this.AssociatedChart;
        }