示例#1
0
        public FixedChannelChart()
        {
            InitializeComponent();

            _player = new WaveformPlayer(-120, 0);
            ContentControlChart.Content = _player.ContainerChart;

            var color0  = Colors.Brown;
            var config0 = new WaveformPlayerConfig
            {
                Color   = Color.FromArgb(100, color0.R, color0.G, color0.B),
                Maximum = 0,
                Minimum = -120,
            };

            _max = _player.AddNewWaveformPlayer(config0);

            var color1  = Colors.DarkOrange;
            var config1 = new WaveformPlayerConfig
            {
                Color   = Color.FromArgb(100, color1.R, color1.G, color1.B),
                Maximum = 0,
                Minimum = -120,
            };

            _current = _player.AddNewWaveformPlayer(config1);

            var color2  = Colors.OrangeRed;
            var config2 = new WaveformPlayerConfig
            {
                Color   = Color.FromArgb(100, color2.R, color2.G, color2.B),
                Maximum = 0,
                Minimum = -120,
            };

            _min = _player.AddNewWaveformPlayer(config2);

            _player.Initialize(0.0d, 1.0d, 500);

            _player.SelectedValueChanged += OnSelectedValueChanged;

            SizeChanged += (sender, args) => _player.SetBounds((int)RootLayout.ActualWidth, (int)RootLayout.ActualHeight - 10);
        }
示例#2
0
        public SampleDataSeries AddNewWaveformPlayer(WaveformPlayerConfig config)
        {
            var chartView = ContainerChart.ViewXY;

            var yAxis = chartView.YAxes.AddNew();

            // ReSharper disable once PossibleNullReferenceException
            yAxis.MouseInteraction = false;
            yAxis.Title.Visible    = false;
            yAxis.Visible          = false;
            yAxis.SetRange(config.Minimum, config.Maximum);

            chartView.DropOldSeriesData = false;

            var series = new SampleDataSeries(chartView, chartView.XAxes[0], yAxis);

            chartView.SampleDataSeries.Add(series);
            series.LineStyle.Width  = 1;
            series.LineStyle.Color  = Color.FromArgb(100, config.Color.R, config.Color.G, config.Color.B);
            series.MouseInteraction = false;
            return(series);
        }