How do I stop cliping of axis labels?

Oct 20, 2009 at 11:02 AM

I have a graph than has 0,0 as a lower limit - so I have "plotter.Domain = new DataRect(0, 0, max, max);" but the 0 labels on the graph are being clipped:

The same problems happens with the values at the top of the axis (8000 on the y-axis in this case), but I'm less concerned about that.

How can I stop the 0 values being clipped on this graph?

Editor
Oct 21, 2009 at 8:55 AM

Hi,

in the most recent version of source code (changeset 29117) you can find a property IsStaticAxis of AxisControl class.

For example, if you have HorizontalAxis axis = new HorizontalAxis(); then you can execute the following code: axis.AxisControl.IsStaticAxis = true;

This will make axis labels that are close to sides of axis, to change their position so that they are no more clipped.

 

By the way, as I see from the picture, toy have expanded D3 a little and created an area chart, isn't it?

Best regards,

Mikhail.

Oct 22, 2009 at 2:40 PM

Thanks, that has fixed the problem with the zeros on the graph. However, it seems there's an issue with the high end. On this graph, which goes from 0 to 255 on the horizontal axis (it's a histogram for an 8bit image) the high values overlap each other:

Also, I haven't expanded D3 for area charts - that was just a line graph showing a histogram of a 16bit image - so all the up and down lines squashed together make it look like an area graph, when really it's still a line graph.

Editor
Oct 22, 2009 at 4:38 PM

Hi,

I'll try to create some fix. Maybe there will be separate properties for left and right sides of axis.

Regards,

Mikhail.

Oct 30, 2009 at 11:02 PM

Hmm.

I don't like the fact that using IsStaticAxis ... moves the position of the label ...

Is there a way to just not clip the labels?

Thanks,

Cory

Editor
Nov 1, 2009 at 5:56 PM

Hi Cory,

please take a look at changeset 29226, there is alternative solution, enabled by default.

Best regards,

Mikhail.

Nov 2, 2009 at 4:07 PM

Hi Mikhail,

I like that the labels no longer clip ... but I don't care for how the Y axis labels now appear 'on top' of the chart ... how do I turn that off ... so that the labels are once again on the side by the tick marks?

By the way ... nice job with this library ...

Cory

Editor
Nov 2, 2009 at 7:51 PM

Fixed in changeset 29239.

Nov 3, 2009 at 3:56 PM

This works much better ... however I notice that it still clips the labels if you resize the graph small enough.

Nov 9, 2010 at 9:08 PM

I am using version 0.3 and see no option for IsStaticAxis... and the clipping problems exactly as described in the first post above on both x- and y- axes persist.

How to fix this ??

I am using a plot with a HorizontalDateTimeAxis like this

<Window x:Class="CurrencyExchangeSample.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:c="http://research.microsoft.com/DynamicDataDisplay/1.0"
    Title="Window1" WindowState="Maximized">
	<Grid>
		<c:ChartPlotter Name="plotter">
			<c:ChartPlotter.HorizontalAxis>
				<c:HorizontalDateTimeAxis Name="dateAxis"/>
			</c:ChartPlotter.HorizontalAxis>
		</c:ChartPlotter>
	</Grid>
</Window>