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.
- Quyen Sy asked 12 months ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 12 months ago
-
Hi Andrew, I have added more info. Did you find any clue?
- You must login to post comments
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.
- Quyen Sy answered 12 months ago
- last edited 12 months ago
-
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 login to post comments
Please login first to submit.