Exemple #1
0
        /// <summary>
        /// Export the bar series to an oxyplot series.
        /// </summary>
        /// <param name="series">The bar series to be exported.</param>
        /// <param name="labels">Existing axis labels.</param>
        protected override (Series, AxisLabelCollection) Export(BarSeries series, AxisLabelCollection labels)
        {
            ColumnXYSeries result = new ColumnXYSeries();

            if (series.ShowOnLegend)
            {
                result.Title = series.Title;
            }

            result.FillColor   = series.FillColour.ToOxyColour();
            result.StrokeColor = series.Colour.ToOxyColour();

            DataPointCollection data = GetDataPoints(series.X, series.Y, labels);

            result.ItemsSource = data.Points;

            return(result, data.Labels);
        }
Exemple #2
0
        public void DrawBar(
            string title,
            IEnumerable x,
            IEnumerable y,
            Models.Graph.Axis.AxisType xAxisType,
            Models.Graph.Axis.AxisType yAxisType,
            Color colour,
            bool showOnLegend)
        {
            ColumnXYSeries series = new ColumnXYSeries();

            if (showOnLegend)
            {
                series.Title = title;
            }
            series.FillColor   = ConverterExtensions.ToOxyColor(colour);
            series.StrokeColor = ConverterExtensions.ToOxyColor(colour);
            series.ItemsSource = this.PopulateDataPointSeries(x, y, xAxisType, yAxisType);
            series.XAxisKey    = xAxisType.ToString();
            series.YAxisKey    = yAxisType.ToString();
            this.plot1.Model.Series.Add(series);
        }
Exemple #3
0
 public void DrawBar(
     string title,
     IEnumerable x,
     IEnumerable y,
     Models.Graph.Axis.AxisType xAxisType,
     Models.Graph.Axis.AxisType yAxisType,
     Color colour,
     bool showOnLegend)
 {
     if (x != null && y != null)
     {
         ColumnXYSeries series = new ColumnXYSeries();
         if (showOnLegend)
         {
             series.Title = title;
         }
         series.FillColor   = OxyColor.FromArgb(colour.A, colour.R, colour.G, colour.B);
         series.StrokeColor = OxyColor.FromArgb(colour.A, colour.R, colour.G, colour.B);
         series.ItemsSource = this.PopulateDataPointSeries(x, y, xAxisType, yAxisType);
         series.XAxisKey    = xAxisType.ToString();
         series.YAxisKey    = yAxisType.ToString();
         this.plot1.Model.Series.Add(series);
     }
 }