Bug in AxisBase.GetInsertionIndexByPlacement?

Jun 15, 2009 at 2:33 PM

I think the placement of left/top and right/bottom axes is inverted. i.e. the bottom and right axes should be the first elements in their containing panel and the top/left axes should be the last element. Corrected method is:

		private int GetInsertionIndexByPlacement(AxisPlacement placement, Panel panel)
		{
			int index = panel.Children.Count;

			switch (placement)
			{
				case AxisPlacement.Right: // Was AxisPlacement.Left
					index = 0;
					break;
				case AxisPlacement.Bottom: // Was AxisPlacement.Top
					index = 0;
					break;
				default:
					break;
			}

			return index;
		}


Editor
Jun 26, 2009 at 5:06 PM

Hi,

 

Idea was that axes that are added later, should be farther from viewport that axes added earlier. That's why we are inserting them at 0th index in left and top panels.

 

Best regards,

Mikhail.

Jun 26, 2009 at 5:57 PM

That makes sense. But if you add an axes AFTER an axes title, the newly added axes appears in the wrong place. Try this sequence:

  1. Create a ChartPlotter, which will generate the default vertical & horizontal axes.
  2. Add a HorizontalAxisTitle
  3. Replace the default horizontal axis with a new horizontal axis

Now the axis title will be closer to the viewport than the horizontal axis.

Editor
Jul 13, 2009 at 6:50 PM

We'll try to change behaviour of axis titles so that it make sence.

Best regards,

Mikhail.

Editor
Aug 9, 2009 at 5:05 PM

Hi!

Bug you've reported was fixed - you can get the latest code without it from 'Source code' page, latest Changeset.

Also I've added ability to place HorizontalAxisTitle on the top and VerticalAxisTitle on the right side of plotter.

 

Best regards,

Mikhail.