Jump to content
Software FX Community

X-axis top/bottom margins


dksimon

Recommended Posts

The following XAML shows how to minimize the space used by the X axis

<StackPanel Orientation="Horizontal" Grid.Row="1">

<cfx:Chart Gallery="Bar" x:Name="chart1" Width="300" Height="280" Style="{x:Static cfxMotifs:Basic.Style}">

  <cfx:Chart.Series>

  <cfx:SeriesAttributes/>

  </cfx:Chart.Series>

  <cfx:Chart.LegendBox>

  <cfx:LegendBox Visibility="Collapsed"/>

 

</cfx:Chart.LegendBox>

 

</cfx:Chart>

 

<cfx:Chart Gallery="Bar" x:Name="chart2" Width="300" Height="280" Style="{x:Static cfxMotifs:Basic.Style}">

 

<cfx:Chart.Series>

 

<cfx:SeriesAttributes/>

 

</cfx:Chart.Series>

 

<cfx:Chart.LegendBox>

 

<cfx:LegendBox Visibility="Collapsed"/>

 

</cfx:Chart.LegendBox>

 

<cfx:Chart.PlotArea>

 

<cfx:PlotAreaAttributes Margin="8"/>

 

</cfx:Chart.PlotArea>

 

<cfx:Chart.AxisX>

 

<cfx:Axis Separation="0">

 

<cfx:Axis.Grids>

 

<cfx:Grids>

 

<cfx:Grids.Major>

 

<cfx:GridLine TickSize="4"/>

 

</cfx:Grids.Major>

 

<cfx:Grids.Minor>

 

<cfx:GridLine TickSize="2"/>

 

</cfx:Grids.Minor>

</cfx:Grids>

</cfx:Axis.Grids>

</cfx:Axis>

 

</cfx:Chart.AxisX>

 

</cfx:Chart>

</StackPanel>

Note the following

- Chart.Style set to Basic to simplify the chart layout

- PlotArea.Margin set to 8, this is not directly related to your question but will minimize space taken on the top and right of the plot area. You could set the margin to 0 if you do not show the chart border, otherwise it might look a little crowded

- Axis.Separation set to 0

- GridLine.TickSize reduced for both Major and Minor Grid lines. Note that you can win a little more space by setting the TickMark to None

We found that we can save a few more pixels when Separation is set to 0, this will be fixed in future hotfixes/service packs.

Regards,

JuanC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...