SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0
0

Hi,

I’m using the following code for showing/hiding the axis:

    /// <summary>
    /// Show/hide all axis and labels
    /// </summary>
    /// <param name="visibility">The visibility status</param>
    public void ShowHideAllAxis(Visibility visibility)
    {
        if (this.RenderableSeries != null)
        {
            for (int seriesCnt = 0; seriesCnt < this.RenderableSeries.Count; seriesCnt++)
            {
                var renderSeries = this.RenderableSeries.ElementAt(seriesCnt);
                var axis = this.YAxes.GetAxisById(renderSeries.YAxisId);

                if (axis != null)
                {
                    ((AxisBase)axis).Visibility = visibility;
                }
            }
        }
    }

This will hide everything.
Is there a way for only showing the axis title and hide the rest of the axis stuff?

Thanks,
Egbert

  • You must to post comments
0
0

Hi Egbert,

The following properties on the Axis allow you to show or hide various parts of this component:

  • AxisBase.DrawLabels
  • AxisBase.DrawMajorTicks
  • AxisBase.DrawMinorTicks
  • AxisBase.DrawMajorGridLines
  • AxisBase.DrawMinorGridLines

You can test these properties out in the demo Modify Axis Properties

Hope this helps!

Andrew

  • EJansen
    Hi Andrew,Thanks for this info, but when disabling all the draw stuff, the axis title is displayed (that's good) but also the axis line (no tickmarks, no numbers, only the line). It doesn't look good this way.It there another way the display this info? Legends?Thanks...
  • Andrew
    Hi Egbert,I think you can set the Axis Border to Transparent, or BorderThickess to 0 to hide the line. Can you try this and let me know what happens?Best regards, Andrew
  • EJansen
    Hi Andrew,I used the BorderThickness and it works great. Thanks...
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.