Pre loader

Y-axis labels are gone when majorDelta is set to 0.1

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

I have a chart with default majorDelta 10 for y-axis. Users are allowed to change the scale (majorDelta) of the chart. When it’s changed to 0.1, the y-axis labels are gone. The y-axis labels can still be seen when the majorDelta is 0.2. Please check my screenshots for details.

Version
2.2.2415, 3.1.333
Images
  • You must to post comments
0
0

Hi Quyền,

What’s happening is you’ve chosen a major delta that is too small to view all the labels and SciChart is hiding the ones which overlap (which is all of them)

You can disable label overlapping by passing hideOverlappingLabels = false to the axis constructor. This property may also be set dynamically by setting axis.axisRenderer.hideOverlappingLabels.

Try that and let me know if labels show up. If not, we can investigate further.

Best regards
Andrew

  • Quyen Sy
    Hi Andrew, I have added more info. Did you find any clue?
  • You must to post comments
0
0

Hi Andrew,

I tried to set hideOverlappingLabels to false in the axis constructor. But it doesn’t help and it also caused UI issue when I set the majorDelta to small values (Please check the attached screenshot). Not sure if I have any settings wrong, please check my codes of the axis constructor:

        const yAxis = new NumericAxis(wasmContext, {
                axisTitle: "Power (dBm)",
                axisTitleStyle: {
                    fontSize: CHART_STYLE.AXIS_FONT_SIZE,
                            fontFamily: "sans-serif",
                            fontWeight: "bold"
                },
                labelStyle: {
                           fontSize: CHART_STYLE.LABEL_FONT_SIZE,
                            fontFamily: "sans-serif"
                },
                autoTicks: false,
                majorDelta: specSettings.scale,
                minorDelta: specSettings.scale / 5,
                axisAlignment: EAxisAlignment.Left,
                visibleRange: yAxisNumberRange,
                visibleRangeLimit: yAxisNumberRange,
                zoomExtentsRange: yAxisNumberRange,
                labelFormat: ENumericFormat.Decimal,
                labelPrecision: 2,
                cursorLabelFormat: ENumericFormat.Decimal,
                cursorLabelPrecision: 2,
                drawMajorBands: false,
                hideOverlappingLabels: false,
    });

The value of specSettings.scale above is limited to 0.1 to 20. When it’s equal to 0.1, the y-axis labels will be gone even hideOverlappingLabels is set to false.

Images
  • Andrew Burnett-Thompson
    Hi Quyen, maybe there’s an exception or error in the JS Console? My suggestion is – please provide us with a codepen to reproduce this issue and we will look into it.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.