Пример #1
0
        void ChartToBeReturned_CustomizeLegend(object sender, CustomizeLegendEventArgs e)
        {
            e.LegendItems.Clear();

            if (IsWellClassLegend)
            {
                foreach (var item in cGlobalInfo.ListWellClasses)
                {
                    LegendItem newItem = new LegendItem();
                    newItem.ImageStyle = LegendImageStyle.Marker;
                    newItem.MarkerStyle = MarkerStyle.Square;
                    newItem.MarkerSize = 8;
                    newItem.MarkerBorderColor = newItem.MarkerColor = item.ColourForDisplay;
                    newItem.ShadowColor = Color.Black;
                    newItem.ShadowOffset = 1;
                    newItem.Cells.Add(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft);
                    newItem.Cells.Add(LegendCellType.Text, item.Name, ContentAlignment.MiddleLeft);
                    e.LegendItems.Add(newItem);
                }
            }
            if (IsCellularPhenotypeLegend)
            {
                foreach (var item in cGlobalInfo.ListCellularPhenotypes)
                {
                    LegendItem newItem = new LegendItem();
                    newItem.ImageStyle = LegendImageStyle.Marker;
                    newItem.MarkerStyle = MarkerStyle.Square;
                    newItem.MarkerSize = 8;
                    newItem.MarkerBorderColor = newItem.MarkerColor = item.ColourForDisplay;
                    newItem.ShadowColor = Color.Black;
                    newItem.ShadowOffset = 1;
                    newItem.Cells.Add(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft);
                    newItem.Cells.Add(LegendCellType.Text, item.Name, ContentAlignment.MiddleLeft);
                    e.LegendItems.Add(newItem);
                }

            }

            //e.LegendItems.Add(
        }
Пример #2
0
 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
   foreach (LegendItem legendItem in e.LegendItems) {
     var series = chart.Series[legendItem.SeriesName];
     if (series != null) {
       bool seriesIsInvisible = invisibleSeries.Contains(series);
       foreach (LegendCell cell in legendItem.Cells) {
         cell.ForeColor = seriesIsInvisible ? Color.Gray : Color.Black;
       }
     }
   }
 }
 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
   if (chart.Series.Count != 4) return;
   e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[3].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
 }
		private void ResourceChart_CustomizeLegend( object sender, CustomizeLegendEventArgs e ) {

			e.LegendItems.Clear();

			foreach ( var series in ResourceChart.Series ) {

				var legendItem = new LegendItem();
				legendItem.SeriesName = series.Name;
				legendItem.ImageStyle = LegendImageStyle.Rectangle;
				legendItem.BorderColor = Color.Empty;
				legendItem.Name = series.Name + "_legendItem";

				legendItem.Cells.Add( LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleCenter );
				legendItem.Cells.Add( LegendCellType.Text, series.LegendText, ContentAlignment.MiddleLeft );

				var col = series.BorderColor != Color.Empty ? series.BorderColor : series.Color;

				if ( series.Enabled ) {
					legendItem.Color = col;
					legendItem.Cells[1].ForeColor = SystemColors.ControlText;
				} else {
					legendItem.Color = Color.FromArgb( col.A / 4, col );
					legendItem.Cells[1].ForeColor = SystemColors.GrayText;
				}
				e.LegendItems.Add( legendItem );
			}
		}
 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
   if (this.chart.Series.Contains(qualitySeries)) e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[QUALITIES].Points.Count == 0 ? Color.Gray : Color.Black;
   if (this.chart.Series.Contains(paretoSeries)) e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[PARETO_FRONT].Points.Count == 0 ? Color.Gray : Color.Black;
 }
 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
   if (chart.Series.Count != 3) return;
   e.LegendItems[0].Cells[1].ForeColor = chart.Series[ALL_SAMPLES].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[1].Cells[1].ForeColor = chart.Series[TRAINING_SAMPLES].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[2].Cells[1].ForeColor = chart.Series[TEST_SAMPLES].Points.Count == 0 ? Color.Gray : Color.Black;
 }
 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
   e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[ALL_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[TRAINING_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
   e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[TEST_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
 }
Пример #8
0
        void Chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e)
        {
            e.LegendItems.Clear();
            int IdxSerie = 0;
            foreach (var item in this.Series)
            {
                if (item.Name.Contains("ComplexD_ataTable")) continue;
                if (item.Name == "TrendLine") continue;

                //if (item.Tag != null)
                //{
                LegendItem newItem = new LegendItem();
                newItem.ImageStyle = LegendImageStyle.Marker;
                newItem.MarkerStyle = MarkerStyle.Square;
                newItem.MarkerSize = 8;
                newItem.ShadowColor = Color.Black;
                newItem.ShadowOffset = 1;

                if (item.Tag != null)
                {
                    if (item.Tag.GetType() == typeof(cWellClassType))
                        newItem.MarkerBorderColor = newItem.MarkerColor = ((cWellClassType)(item.Tag)).ColourForDisplay;
                    else if (item.Tag.GetType() == typeof(cCellularPhenotype))
                        newItem.MarkerBorderColor = newItem.MarkerColor = ((cCellularPhenotype)(item.Tag)).ColourForDisplay;
                    else
                        newItem.MarkerBorderColor = newItem.MarkerColor= item.Color;
                }
                else
                {
                    cLUTProcess LUTProcess = new cLUTProcess(cGlobalInfo.GraphsLUT);

                    int IdxColor = IdxSerie % LUTProcess.GetNumberOfColors();
                    newItem.MarkerBorderColor = newItem.MarkerColor = LUTProcess.GetColor(IdxColor);
                }

                newItem.Cells.Add(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft);
                newItem.Cells.Add(LegendCellType.Text, item.Name, ContentAlignment.MiddleLeft);
                e.LegendItems.Add(newItem);
                IdxSerie++;
                //}
            }
        }
 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
   foreach (var item in e.LegendItems)
     foreach (var cell in item.Cells)
       cell.ForeColor = invisibleLegendItems.Any(x => x.Name == item.Name) ? Color.Gray : Color.Black;
 }