Exemplo n.º 1
0
        public InjectedPlotterVerticalSyncConverter(InjectedPlotter plotter)
        {
            if (plotter == null)
            {
                throw new ArgumentNullException("plotter");
            }

            this.injectedPlotter = plotter;
        }
        private static void OnTransformChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            InjectedPlotter plotter = (InjectedPlotter)d;

            plotter.UpdateTransform();
        }
Exemplo n.º 3
0
		private void DrawPlots()
		{
			HorizontalAxis xAxis = (HorizontalAxis)plotter.MainHorizontalAxis;
			xAxis.TicksProvider = new LogarithmNumericTicksProvider(10);
			xAxis.LabelProvider = new UnroundingLabelProvider();
			xAxis.ShowMajorLabels = true;
			xAxis.ShowMinorTicks = true;
			xAxis.SnapsToDevicePixels = true;

			xAxis.LabelProvider.SetCustomFormatter(info => info.Tick.ToString("#.######e0"));

			HorizontalAxisTitle HAT = new HorizontalAxisTitle()
			{
				Content = _xAxisInfo.AxisTitle
			};

			plotter.MainHorizontalAxis = xAxis;
			plotter.Children.Add(HAT);
			((NumericAxis)plotter.MainHorizontalAxis).AxisControl.TicksPath.Stroke = Brushes.Blue;

			VerticalAxis yAxis = (VerticalAxis)plotter.MainVerticalAxis;
			yAxis.TicksProvider = new NumericTicksProvider();
			yAxis.LabelProvider = new UnroundingLabelProvider();
			yAxis.ShowMajorLabels = true;
			yAxis.ShowMinorTicks = true;
			yAxis.SnapsToDevicePixels = true;


			VerticalAxisTitle VAT = new VerticalAxisTitle()
			{
				Content = _yAxisInfoList[0].AxisTitle
			};

			plotter.MainVerticalAxis = yAxis;
			plotter.Children.Add(VAT);
			plotter.AxisGrid.DrawVerticalMinorTicks = true;
			plotter.AxisGrid.DrawHorizontalMinorTicks = true;
			plotter.MainVerticalAxis.Background = new LinearGradientBrush(Colors.White, Colors.LightGray, 90);

			var xPoints = _xAxisInfo.AxisDataPoints.AsXDataSource();

			// Create the main plot
			foreach (AxisInfo yAxInfo in _yAxisInfoList)
			{
				var yPoints = yAxInfo.AxisDataPoints.AsYDataSource();

				CompositeDataSource plot = xPoints.Join(yPoints);
				plotter.AddLineGraph(plot, yAxInfo.PlotColor, yAxInfo.PlotLineThickness, yAxInfo.AxisLegend);
			}


			// add secondary y-axis plots if any exist
			if (_yAxisInfoSecList != null)
			{
				InjectedPlotter innerPlotter = new InjectedPlotter();
				innerPlotter.SetViewportBinding = false;
				plotter.Children.Add(innerPlotter);

				HorizontalAxis ax = new HorizontalAxis();
				ax.Placement = AxisPlacement.Top;
				ax.TicksProvider = new LogarithmNumericTicksProvider(10);
				ax.LabelProvider = new UnroundingLabelProvider();
				ax.LabelProvider.SetCustomFormatter(info => info.Tick.ToString("#.######e0"));
				ax.ShowMajorLabels = true;
				ax.ShowMinorTicks = true;
				ax.SnapsToDevicePixels = true;
				ax.AxisControl.TicksPath.Stroke = Brushes.Red;
				plotter.Children.Add(ax);


				VerticalAxis yAxisSec = new VerticalAxis()
				{
					TicksProvider = new NumericTicksProvider(),
					LabelProvider = new UnroundingLabelProvider(),
					ShowMinorTicks = true,
					ShowMajorLabels = true,
					SnapsToDevicePixels = true,
					Placement = AxisPlacement.Right
				};

				VerticalAxisTitle VATsecondary = new VerticalAxisTitle()
				{
					Content = _yAxisInfoSecList[0].AxisTitle,
					Placement = AxisPlacement.Right
				};

				innerPlotter.MainVerticalAxis = yAxisSec;
				innerPlotter.Children.Add(VATsecondary);
				innerPlotter.MainVerticalAxis.Background = new LinearGradientBrush(Colors.White, Colors.Red, 90);

				foreach (AxisInfo yAxInfoSec in _yAxisInfoSecList)
				{
					var ySecPoints = yAxInfoSec.AxisDataPoints.AsYDataSource();

					CompositeDataSource plotSec = xPoints.Join(ySecPoints);
					/*innerP*/
					plotter.AddLineGraph(plotSec, yAxInfoSec.PlotColor, yAxInfoSec.PlotLineThickness, yAxInfoSec.AxisLegend);
				}

			}
		}
Exemplo n.º 4
-1
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.btnClosed = ((System.Windows.Controls.Button)(target));
     
     #line 17 "..\..\..\..\MyUserControl\TrainRecordDialog.xaml"
     this.btnClosed.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.btnClosed_PreviewMouseLeftButtonDown);
     
     #line default
     #line hidden
     return;
     case 2:
     this.plotter = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
     
     #line 27 "..\..\..\..\MyUserControl\TrainRecordDialog.xaml"
     this.plotter.Loaded += new System.Windows.RoutedEventHandler(this.plotter_Loaded);
     
     #line default
     #line hidden
     return;
     case 3:
     this.axis = ((Microsoft.Research.DynamicDataDisplay.Charts.Axes.HorizontalIntegerAxis)(target));
     return;
     case 4:
     this.innerPlotter = ((Microsoft.Research.DynamicDataDisplay.InjectedPlotter)(target));
     return;
     case 5:
     this.plotter2 = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
     return;
     case 6:
     this.xAxis = ((Microsoft.Research.DynamicDataDisplay.Charts.Axes.IntegerAxis)(target));
     return;
     case 7:
     this.barChart = ((Microsoft.Research.DynamicDataDisplay.Charts.ClusteredBarChart)(target));
     return;
     }
     this._contentLoaded = true;
 }