We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

removing axis

Does anyone know if there's a ways to hide the chart X an Y axis? When I don't specify them the chart seems to add them by default.

This is to essentially create a thumb of the full size series. As such, I need to remove all vertical and horizontal spacing between the chart and the chart area but am stuck with CharArea.AxesThickness being set locally by the ChartArea.

I tried setting CharArea.AxesThickness to 0,0,0,0 on loading of the chart (after it's set by the ChartArea) but that seems very brute force and I'm usure as to the problems this may cause elsewhere when the chart is rendered..

Any help would be appreciated,

Thanks


5 Replies

PJ Pavithra J Syncfusion Team May 1, 2009 06:21 AM UTC

Hi SFL,

Thanks for your interest in Syncfusion products.

The horizontal and the vertical space between the Chart and the ChartArea can be removed by setting the property Margin with the appropriate value. For your reference we have created a sample and you could download from the below given link,


Sample illustrates Using Margin Property

Please let us know if you have further queries.

Regards,
Pavithra.J




AD Administrator Syncfusion Team May 4, 2009 09:44 PM UTC

Hi Pavithra,

Thanks for the post.

I had already removed all padding and margins I could think of but was still getting space between the Chart and ChartArea. In the example below (also attached) I add a simple chart to a window and set all margins and padding to zero but as you can see some light blue still outlines the chart so I would assume it's margin on the ChartArea or Padding on the Chart but both are set to 0....

I know this shouldn't be a big problem normally but if all we want is the graph and need to rely an it's with for overlaying something proportional on top, then spacing becomes a problem...

In the end, I was able to achieve what I wanted by making the margin negative and removing ElementMargin from ChartDockPanel but I doubt that's the right way to do it...

An alternative I'm considering is to put margins on the overlay but I'm not sure if the chart exposes the size of the spacing between the edge of the chart and start of the series...

Any help would be appreciated.

/SFL

== XAML below ==
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sync="http://schemas.syncfusion.com/wpf"
Title="Window1" Height="300" Width="300"
Margin="0"
Padding="0"
Background="Yellow"
>
Background="Orange"
>
VerticalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
BorderThickness="0"
Margin="0"
Padding="0"
Background="LightBlue"
sync:ChartType.Spacing ="0"
>

CornerRadius="0"
BorderThickness="0"
BorderBrush="Transparent"
Margin="0"
Padding="0"
Background="Wheat"
>


























Window1.xaml_1afc10d8.zip


PJ Pavithra J Syncfusion Team May 5, 2009 04:25 AM UTC

Hi SFL,

Thanks for your interest in Syncfusion products.

The way you have found by setting the Margin to Negative values is right. You could also see, that I have also used nagative values for Margin in my attached sample in the above thread.

Please let me know if you have further queries.

Regards,
Pavithra.J



AD Administrator Syncfusion Team May 5, 2009 02:43 PM UTC

Thanks Pavithra,

I thought you meant setting the margin to zero in your initial post, apologies for the mix-up.

Thanks for your help,

SFL



PJ Pavithra J Syncfusion Team May 11, 2009 06:27 AM UTC

Hi SFL,

Thanks for your update.

Please let us know if you have further queries.

Thank you for choosing Syncfusion products.

Regards,
Pavithra.J


Loader.
Live Chat Icon For mobile
Up arrow icon