Jump to content
Software FX Community

Collapse the AxisPainter, but keep Axis.CustomGridLines visible.

Recommended Posts


 I have a line chart, and I would like its plot area to fill the total area of my chart, as if I set Axis.Visibility=Collapsed.

My problem is that, if I do so, the CustomGridLines defined for this axis don't appear anymore.

 Is there a way to do that?

Share this post

Link to post
Share on other sites

To hide the axis labels (and reduce space occupied by it) you can try the following code

  chart1.PlotArea.Margin = new Thickness(0, 0, 0, 0);
  chart1.AxisY.Labels.Visibility = AxisLabelVisibility.Collapsed;
  chart1.AxisY.Grids.Major.TickMark = TickMark.None;
  chart1.AxisY.Grids.Major.TickSize = 0;
  chart1.AxisY.Grids.Minor.TickMark = TickMark.None;
  chart1.AxisY.Grids.Minor.TickSize = 0;
  chart1.AxisY.Separation = 0;

Note that there will be a small space (about 2-3 pixels). In our next 8.1 build this should be reduced. If you are also hiding the X axis you could remove the chart's outside border so that you do not get the "double border" effect.



Share this post

Link to post
Share on other sites

We uploaded a new hotfix containing this fix (and a couple of other fixes). Hotfixes do not have the same level of testing as service packs so they can be provided in a more agile manner.JuanC

Share this post

Link to post
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.

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...