Pre loader

SciChartSurface: Adding YAxes adds hidden space/gap/margin

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
0
0

Hello,

I use a Scrollbar/Surface combination to have an overview over several RenderSeries. Since I need individual scaling on each Series I also add 1 YAxis per Renderseries

The problem is that (even when disabling everything drawing related to an axis) adding an axis adds 2 px of white space where the axis would be.

In the attached image you can see an example with 15 axes added.

Here’s the code adding the RenderSeries and the axis (we already tried so many things to make the whitespace disappear as you can see in “createNewAxis”):

public void AddSciRenderSeries(FastLineRenderableSeries renderableSeries)
{
    if (OverviewChartSurface.RenderableSeries.Contains(renderableSeries))
        return;

    OverviewChartSurface.YAxes.Add(createNewAxis(renderableSeries.YAxisId));
    OverviewChartSurface.RenderableSeries.Add(renderableSeries);
    OverviewChartSurface.ZoomExtents();
}

private NumericAxis createNewAxis(string channelId)
{
    NumericAxis scrollerYAxis1 = new NumericAxis();
    scrollerYAxis1.AutoRange = SciChart.Charting.Visuals.Axes.AutoRange.Always;

    scrollerYAxis1.DrawMajorBands = false;
    scrollerYAxis1.DrawMajorGridLines = false;
    scrollerYAxis1.DrawMajorTicks = false;
    scrollerYAxis1.DrawMinorGridLines = false;
    scrollerYAxis1.DrawMinorTicks = false;
    scrollerYAxis1.DrawLabels = false;

    scrollerYAxis1.BorderBrush = Brushes.Red;
    scrollerYAxis1.FontSize = 0.1;
    Trace.WriteLine("AxisOffset: " + scrollerYAxis1.GetAxisOffset());
    scrollerYAxis1.Padding = new Thickness(0);
    scrollerYAxis1.Margin = new Thickness(0);
    scrollerYAxis1.BorderThickness = new Thickness(0);
    scrollerYAxis1.Id = channelId;

    return scrollerYAxis1;
}

What shall we do to remove the gap on the right?

Thanks for your help!

Version
v5.4.0.12119
Images
  • You must to post comments
Best Answer
0
0

Ok, I just found out that setting yaxis.Width = 0; solves the problem for us. The occupied space of the axis is then reduced to 0px.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.