Beispiel #1
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="parent"></param>
		public Axis(AxesBox parent)
			: base(parent)
		{
			_tickLength = 8;

			_labelPane = new LabelPane() {
				OriginLocation = AnchorLocation.Center
			};
			_labelPane.Label.Body = "label";

			Start = new Vector();
			Stop = new Vector();
		}
Beispiel #2
0
		/// <summary>
		/// Automatically generates the ticks based on the parent's plot bounds.
		/// </summary>
		/// <param name="dim"> The dimension that this axis represents.</param>
		public void GenerateTicks(int dim)
		{
			_dimension = dim;
			double min = ParentAxes.PlotBounds.Minima[dim];
			double max = ParentAxes.PlotBounds.Maxima[dim];
			
			// get the tick values
			_tickVals = Bounds.NiceRange(min, max, true);

			// store the tick labels
			_tickLabels = new LabelPane[_tickVals.Length];
			for (int i = 0; i < _tickVals.Length; i++)
			{
				_tickLabels[i] = new LabelPane() {
					OriginLocation = AnchorLocation.Center
				};
				_tickLabels[i].Label.Body = String.Format("{0:0.###}", _tickVals[i]);
			}
		}