Пример #1
0
        public List <AxisCore> MapXAxes(ChartCore chart)
        {
            if (DesignerProperties.GetIsInDesignMode(this) || AxisX == null)
            {
                AxisX = DefaultAxes.DefaultAxis;
            }

            //if (AxisX.Count == 0)
            //    AxisX.AddRange(DefaultAxes.CleanAxis);

            if (AxisX.Count == 0)
            {
                AxisX.Add(new Axis {
                    Separator = new Separator()
                });
            }

            return(AxisX.Select(x =>
            {
                if (x.Parent == null)
                {
                    x.AxisOrientation = AxisOrientation.X;
                    if (x.Separator != null)
                    {
                        chart.View.AddToView(x.Separator);
                    }
                    chart.View.AddToView(x);
                }
                return x.AsCoreElement(Model, AxisOrientation.X);
            }).ToList());
        }
Пример #2
0
 public List <AxisCore> MapXAxes(ChartCore chart)
 {
     if (AxisX.Count == 0)
     {
         AxisX.Add(DefaultAxes.CleanAxis);
     }
     return(AxisX.Select(x =>
     {
         if (x.Parent == null)
         {
             chart.View.AddToView(x);
         }
         return x.AsCoreElement(Model, AxisTags.X);
     }).ToList());
 }
Пример #3
0
        private void Initialize()
        {
            Clear();
            Serie = new ColumnSeries
            {
                ColumnPadding = 0,
                Title         = "Count"
            };
            Series = new SeriesCollection {
                Serie
            };

            var xAxis = new Axis
            {
                Separator = new Separator
                {
                    Step   = 32,
                    Stroke = Brushes.Black
                },
                MinValue   = -1,
                MaxValue   = 256,
                Foreground = Brushes.Black
            };

            AxisX.Add(xAxis);

            var yAxis = new Axis
            {
                Separator = new Separator
                {
                    Stroke = Brushes.Black
                },
                MinValue   = 0,
                Foreground = Brushes.Black
            };

            AxisY.Add(yAxis);
        }