Pre loader

X and Y axis formatting

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

0
0

On my x axis, how can I keep from showing duplicate ticks?
On my y axis, how do I right justify all my values?

Images
  • You must to post comments
0
0

Hi there,

Please, try this workaround for Y axis labels alignment:

<SciChart:SciChartSurface.YAxis>
                <SciChart:NumericAxis AxisAlignment="Left" GrowBy="0, 0.1" >
                    <SciChart:NumericAxis.Resources>
                        <Style TargetType="TextBlock">
                            <Setter Property="Canvas.Right" Value="8"></Setter>
                        </Style>
                    </SciChart:NumericAxis.Resources>
                </SciChart:NumericAxis>
        </SciChart:SciChartSurface.YAxis>

MajorTick’s length is 6 dpi by default, so you can choose any greater value(as 8 in the code above).

Hope this helps!

Best regards,
Yuriy

  • tpayton
    Thanks. The alignment code worked well
  • You must to post comments
0
0

Hi,

You need to set the IAxis.TextFormatting property to proper formatting string, e.g. XAxis.TextFormatting=”0.#####”. Also you could use a LabelFormatter feature, please, take a look at Screenshots, XPS Printing, X-Axis Text Labels tutorial.

Regarding labels alignment on Y axis, it can’t be changed in SciChart 1.x, but we are going to provide such capabilities in 2.0 version. We can look for a workaround if this is critical issue for you. Also you could consider having YAxis on the right rather than on the left.

Also, I noticed that your chart has empty space between Y axis and the chart area, is it intentionally or this is not desired?

Please, don’t hesitate to ask if you have questions or need any assistance!

Best regards,
Yuriy

  • tpayton
    On the x axis, I dont want more precision than a single decimal place (which I have). I just dont want them to be repeated. Is this possible? Putting the yaxis on the right is not an option. The space between the axis and the chart is not desired, but if I cant right-align the Y axis I would rather keep the space. It makes the numbers easier to read.
  • Yuriy Zadereckiy
    Hi, OK, you could just omit labels, which are repeated. You should create LabelFormatter, save previous label text as a field and return empty string from the LabelFormatter.FormatLabel() if previous and current strings are the same. Regarding Y axis labels, let us to look for some workaround for you. And I can't imagine why this space between the chart and ticks appears. Do you set Margin or Padding or BorderThickness on YAxis? Best regards, Yuriy
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies