Ejemplo n.º 1
0
 public void CreateAxes(int totalX, int totalY)
 {
     while (XAxes.Count < totalX)
     {
         XAxes.Add(new LinearAxis(inverted: false));
     }
     while (YAxes.Count < totalY)
     {
         YAxes.Add(new LinearAxis(inverted: true));
     }
 }
        private void InitializeAxes()
        {
            var xNumAxis = new NumericAxisViewModel
            {
                AxisAlignment   = AxisAlignment.Bottom,
                AxisTitle       = "XAxis",
                DrawMajorBands  = false,
                TextFormatting  = "0.00#",
                VisibleRange    = new DoubleRange(0, 10),
                BorderThickness = new Thickness(3),
                BorderBrush     = new SolidColorBrush(Colors.CadetBlue)
            };

            XAxes.Add(xNumAxis);

            var xDateTimeAxis = new DateTimeAxisViewModel
            {
                AxisAlignment = AxisAlignment.Top,
                Id            = "DateTimeAxis",
                VisibleRange  = new DateRange(new DateTime(2017, 1, 1), new DateTime(2017, 1, 31)),
                StyleKey      = "DateTimeAxisStyle"
            };

            XAxes.Add(xDateTimeAxis);

            var yNumAxis = new NumericAxisViewModel
            {
                AxisTitle      = "YAxis",
                DrawMajorBands = false,
                TextFormatting = "0.0#",
                VisibleRange   = new DoubleRange(-10, 10)
            };

            YAxes.Add(yNumAxis);

            var yTimeSpanAxis = new TimeSpanAxisViewModel
            {
                Id             = "TimeSpanAxis",
                DrawMajorBands = false,
                VisibleRange   = new TimeSpanRange(TimeSpan.FromHours(1), TimeSpan.FromHours(24)),
                AxisAlignment  = AxisAlignment.Left
            };

            YAxes.Add(yTimeSpanAxis);
        }
Ejemplo n.º 3
0
        private void CreateChartAxis()
        {
            YAxes.Add(new NumericAxisViewModel()
            {
                AutoRange     = AutoRange.Always,
                AxisTitle     = "Left YAxis",
                Id            = "LeftYAxis",
                AxisAlignment = AxisAlignment.Left,
            });

            YAxes.Add(new NumericAxisViewModel()
            {
                AutoRange     = AutoRange.Always,
                AxisTitle     = "Right YAxis",
                AxisAlignment = AxisAlignment.Right,
            });

            XAxes.Add(new NumericAxisViewModel()
            {
                AutoRange     = AutoRange.Always,
                AxisTitle     = "XAxis",
                AxisAlignment = AxisAlignment.Bottom,
            });
        }