void AxisLayoutAlgorithmPropertyChanged() { switch (AxisLayoutAlgorithm) { case AxisLayoutAlgorithm.Wilkinson: _axisLabeler = new WilkinsonAxisLabeler(); break; case AxisLayoutAlgorithm.ExtendedWilkinson: _axisLabeler = new ExtendedAxisLabeler(); break; case AxisLayoutAlgorithm.MatPlotLib: _axisLabeler = new MatplotlibAxisLabeler(); break; case AxisLayoutAlgorithm.Heckbert: _axisLabeler = new HeckbertAxisLabeler(); break; } }
public Axis layoutAxis() { AxisLabeler labeler = new NoOpAxisLabeler(); if (_options.Symbol is Numeric) switch (algorithm) { case Algorithm.ExtendedWilkinson: labeler = new ExtendedAxisLabeler(); break; case Algorithm.Heckbert: labeler = new HeckbertAxisLabeler(); break; case Algorithm.MatPlotLib: labeler = new MatplotlibAxisLabeler(); break; case Algorithm.Wilkinson: labeler = new WilkinsonAxisLabeler(); break; } else if (_options.Symbol is Factor) labeler = new CategoricalAxisLabeler(); return labeler.Generate(_options, AxisDensity); }
public DataAxis() { SnapsToDevicePixels = true; UseLayoutRounding = true; AxisTicks = new ObservableList<DataAxisTick>(); SizeChanged += (s, e) => OnSizeChanged(); _axisOptions = new AxisLabelerOptions { ComputeLabelRect = ComputeLabelRect, FontSize = TextBlock.GetFontSize(this), Typeface = new Typeface(TextBlock.GetFontFamily(this), TextBlock.GetFontStyle(this), TextBlock.GetFontWeight(this), TextBlock.GetFontStretch(this)) }; _axisLabeler = new ExtendedAxisLabeler(); SetValue(VisibleRangePropertyKey, _visibleRange); _visibleRange.ObserveOnDispatcher().Subscribe(e => { //if (_showDebugMessages) Debug.WriteLine(string.Format("{0:HH:mm:ss.fff} DataAxis: Axis \"{1}\": Updated _visbleRange to: {2}", DateTime.Now, AxisLabel, _visibleRange)); VisibleRangeChanged(); SetValue(VisibleRangePropertyKey, new Range(_visibleRange)); }); var presentationSource = PresentationSource.FromVisual(this); if (presentationSource == null || presentationSource.CompositionTarget == null) return; var matrix = presentationSource.CompositionTarget.TransformToDevice; _pixelsPerInch = Math.Max(matrix.M11, matrix.M22); }