public Window2() { InitializeComponent(); plotter.MainVerticalAxis.Placement = AxisPlacement.Right; //dateAxis.SetConversion(0, new DateTime(2008, 1, 1), 1, new DateTime(2008, 12, 1)); //dateAxis.LabelProvider += LabelProvider_LabelCreated; horizTimeAxis.SetConversion(0, new TimeSpan(), 1, TimeSpan.FromHours(1)); vertTimeAxis.SetConversion(0, new TimeSpan(), 1, TimeSpan.FromDays(1)); //horizDateAxis.SetConversion(0, new DateTime(2008, 1, 1), 1, new DateTime(2008, 12, 1)); //vertDateAxis.SetConversion(0, new DateTime(2008, 1, 1), 1, new DateTime(2008, 12, 1)); //TypifiedChartPlotter<double, double> pl1 = new TypifiedChartPlotter<double, double>(); //pl1.HorizontalAxis = new HorizontalTimeSpanAxis(); HorizontalAxis axis = new HorizontalAxis(); List<CityInfo> cities = new List<CityInfo> { new CityInfo{ Name = "Paris", Coordinate = -3}, new CityInfo{ Name = "Berlin", Coordinate = -1.9}, new CityInfo{ Name = "Minsk", Coordinate = -0.8}, new CityInfo{ Name = "Moscow", Coordinate = 0}, new CityInfo{ Name = "Perm", Coordinate = 2}, new CityInfo{ Name = "Ekaterinburg", Coordinate = 4}, new CityInfo{ Name = "Vladivostok", Coordinate = 9} }; GenericLocationalLabelProvider<CityInfo, double> labelProvider = new GenericLocationalLabelProvider<CityInfo, double>(cities, city => city.Name); labelProvider.SetCustomView((li, uiElement) => { FrameworkElement element = (FrameworkElement)uiElement; element.LayoutTransform = new RotateTransform(-45, 1, 0); }); GenericLocationalTicksProvider<CityInfo, double> ticksProvider = new GenericLocationalTicksProvider<CityInfo, double>(cities, city => city.Coordinate); axis.LabelProvider = labelProvider; axis.TicksProvider = ticksProvider; plotter.Children.Add(axis); HorizontalAxis axis2 = new HorizontalAxis(); CustomBaseNumericTicksProvider provider2 = new CustomBaseNumericTicksProvider(Math.PI); CustomBaseNumericLabelProvider labelProvider2 = new CustomBaseNumericLabelProvider(Math.PI, "π"); axis2.LabelProvider = labelProvider2; axis2.TicksProvider = provider2; plotter.Children.Add(axis2); }
private void SetupLocationalAxis() { HorizontalAxis axis = new HorizontalAxis(); List <CityInfo> cities = new List <CityInfo> { new CityInfo { Name = "Paris", Coordinate = 0.05 }, new CityInfo { Name = "Berlin", Coordinate = 0.2 }, new CityInfo { Name = "Minsk", Coordinate = 0.3 }, new CityInfo { Name = "Moscow", Coordinate = 0.5 }, new CityInfo { Name = "Perm", Coordinate = 0.7 }, new CityInfo { Name = "Ekaterinburg", Coordinate = 0.85 }, new CityInfo { Name = "Vladivostok", Coordinate = 0.9 } }; GenericLocationalLabelProvider <CityInfo, double> labelProvider = new GenericLocationalLabelProvider <CityInfo, double>(cities, city => city.Name); labelProvider.SetCustomView((li, uiElement) => { FrameworkElement element = (FrameworkElement)uiElement; element.LayoutTransform = new RotateTransform(-15, 0, 0); }); GenericLocationalTicksProvider <CityInfo, double> ticksProvider = new GenericLocationalTicksProvider <CityInfo, double>(cities, city => city.Coordinate); axis.LabelProvider = labelProvider; axis.TicksProvider = ticksProvider; plotter.Children.Add(axis); }
public Window2() { InitializeComponent(); plotter.MainVerticalAxis.Placement = AxisPlacement.Right; //dateAxis.SetConversion(0, new DateTime(2008, 1, 1), 1, new DateTime(2008, 12, 1)); //dateAxis.LabelProvider += LabelProvider_LabelCreated; horizTimeAxis.SetConversion(0, new TimeSpan(), 1, TimeSpan.FromHours(1)); vertTimeAxis.SetConversion(0, new TimeSpan(), 1, TimeSpan.FromDays(1)); //horizDateAxis.SetConversion(0, new DateTime(2008, 1, 1), 1, new DateTime(2008, 12, 1)); //vertDateAxis.SetConversion(0, new DateTime(2008, 1, 1), 1, new DateTime(2008, 12, 1)); //TypifiedChartPlotter<double, double> pl1 = new TypifiedChartPlotter<double, double>(); //pl1.HorizontalAxis = new HorizontalTimeSpanAxis(); HorizontalAxis axis = new HorizontalAxis(); List <CityInfo> cities = new List <CityInfo> { new CityInfo { Name = "Paris", Coordinate = -3 }, new CityInfo { Name = "Berlin", Coordinate = -1.9 }, new CityInfo { Name = "Minsk", Coordinate = -0.8 }, new CityInfo { Name = "Moscow", Coordinate = 0 }, new CityInfo { Name = "Perm", Coordinate = 2 }, new CityInfo { Name = "Ekaterinburg", Coordinate = 4 }, new CityInfo { Name = "Vladivostok", Coordinate = 9 } }; GenericLocationalLabelProvider <CityInfo, double> labelProvider = new GenericLocationalLabelProvider <CityInfo, double>(cities, city => city.Name); labelProvider.SetCustomView((li, uiElement) => { FrameworkElement element = (FrameworkElement)uiElement; element.LayoutTransform = new RotateTransform(-45, 1, 0); }); GenericLocationalTicksProvider <CityInfo, double> ticksProvider = new GenericLocationalTicksProvider <CityInfo, double>(cities, city => city.Coordinate); axis.LabelProvider = labelProvider; axis.TicksProvider = ticksProvider; plotter.Children.Add(axis); HorizontalAxis axis2 = new HorizontalAxis(); CustomBaseNumericTicksProvider provider2 = new CustomBaseNumericTicksProvider(Math.PI); CustomBaseNumericLabelProvider labelProvider2 = new CustomBaseNumericLabelProvider(Math.PI, "π"); axis2.LabelProvider = labelProvider2; axis2.TicksProvider = provider2; plotter.Children.Add(axis2); }
private void SetupLocationalAxis() { HorizontalAxis axis = new HorizontalAxis(); List<CityInfo> cities = new List<CityInfo> { new CityInfo{ Name = "Paris", Coordinate = 0.05}, new CityInfo{ Name = "Berlin", Coordinate = 0.2}, new CityInfo{ Name = "Minsk", Coordinate = 0.3}, new CityInfo{ Name = "Moscow", Coordinate = 0.5}, new CityInfo{ Name = "Perm", Coordinate = 0.7}, new CityInfo{ Name = "Ekaterinburg", Coordinate = 0.85}, new CityInfo{ Name = "Vladivostok", Coordinate = 0.9} }; GenericLocationalLabelProvider<CityInfo, double> labelProvider = new GenericLocationalLabelProvider<CityInfo, double>(cities, city => city.Name); labelProvider.SetCustomView((li, uiElement) => { FrameworkElement element = (FrameworkElement)uiElement; element.LayoutTransform = new RotateTransform(-15, 0, 0); }); GenericLocationalTicksProvider<CityInfo, double> ticksProvider = new GenericLocationalTicksProvider<CityInfo, double>(cities, city => city.Coordinate); axis.LabelProvider = labelProvider; axis.TicksProvider = ticksProvider; plotter.Children.Add(axis); }