private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            plotter.Visible = new DataRect(0, 0, 1, 1);

            int count = (int)1e4;
            Point[] pts = new Point[count];

            Random rnd = new Random();
            for (int i = 0; i < count; i++)
            {
                pts[i] = new Point(rnd.NextDouble(), rnd.NextDouble());
            }

            markerChart.AddPropertyBinding<Point>(Shape.ToolTipProperty, p =>
            {
                return String.Format("X: {0:F2}   Y: {1:F2}", p.X, p.Y);
            });

            HSBPalette palette = new HSBPalette();
            markerChart.AddPropertyBinding<Point>(Shape.FillProperty, p =>
            {
                double length = Math.Sqrt(p.X * p.X + p.Y * p.Y) / Math.Sqrt(2);

                return new SolidColorBrush(palette.GetColor(length));
            });

            //markerChart.Filters.Add(new BoundsFilter());
            //markerChart.Filters.Add(new ParallelUnitingPointGroupFilter());
            //markerChart.Filters.Add(new ParallelClusteringFilter { MarkerSize = 8 });
            markerChart.Filters.Add(new UnitingPointGroupFilter { MarkerSize = 6 });
            //markerChart.GetDataAsyncronously = true;
            //markerChart.ShowMarkersConsequently = false;

            markerChart.ItemsSource = pts;
        }
Ejemplo n.º 2
0
		private void OnLoaded(object sender, RoutedEventArgs e)
		{
			GenerateData();

			HSBPalette palette = new HSBPalette();
			//chart1.AddPropertyBinding<Point>(Shape.FillProperty, p =>
			//{
			//    double length = Math.Sqrt(p.X * p.X + p.Y * p.Y) / Math.Sqrt(2);
			//    return new SolidColorBrush(palette.GetColor(length));
			//});
			chart2.AddPropertyBinding<Point>(Shape.FillProperty, p =>
			{
				double length = Math.Sqrt(p.X * p.X + p.Y * p.Y) / Math.Sqrt(2);
				return new SolidColorBrush(palette.GetColor(length));
			});

			//chart1.ItemsSource = data;
			chart2.ItemsSource = data;
		}
		public ColorSelector()
		{
			Palette = new HSBPalette();

			Background = Brushes.Transparent;

			paletteControl.SetBinding(PaletteControl.PaletteProperty, new Binding { Source = this, Path = new PropertyPath("Palette") });
			BottomPanel.Children.Add(paletteControl);

			paletteControl.MouseLeftButtonDown += paletteControl_MouseLeftButtonDown;
			paletteControl.MouseMove += paletteControl_MouseMove;

			Children.Remove(KeyboardNavigation);
			Children.Remove(MouseNavigation);
			Children.Remove(LeftHighlight);
			Children.Remove(RightHighlight);
			Children.Remove(SelectorNavigation);

			Viewport.Domain = new DataRect(0, 0, 1, 1);
		}