Pre loader

Customizing the Tooltip Container Appearance

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 am using your example:
https://www.scichart.com/documentation/js/current/CursorModifier_CustomisingContainer.html

new CursorModifier({
    showYLine: false,
    axisLabelFill: "#484848",
    tooltipLegendOffsetX:  10, - doesn't work
    crosshairStrokeDashArray: [5, 5],
    crosshairStrokeThickness: 1,
    crosshairStroke: _theme.crosshairStrokeSupplyDemand,
    showTooltip: true,
    tooltipSvgTemplate: getTooltipSvgTemplate
})

Is it possible to offset the tooltip from the X-axis? If it is on the right side of the axis, the spacing is maintained, unfortunately, if it is on the left side, it is ‘stuck’ to the line.

Thanks in advance.

Best regards,
Kamil

Version
3.3.567
  • Kamil Macura
    also showLabel doesn’t work in LineAnnotation
  • Jim Risen
    If I’m not mistaken, currently showLabel is supposed to work only in Vertical and Horizonatal Annotations. Please create a separate question if you need a further assitance with the label.
  • You must to post comments
Best Answer
0
1

The offset is applied with adjustTooltipPosition function.
So you can customize it as needed, for example:

const adjustTooltipPosition = (
 width: number,
 height: number,
 svgAnnotation: CursorTooltipSvgAnnotation
) => {
 const { seriesViewRect } = svgAnnotation.parentSurface;
 const xCoord = svgAnnotation.x1;
 const yCoord = svgAnnotation.y1;
 const xCoordShift =
 // +- 5 is an adjustment offset value
  translateToNotScaled(seriesViewRect.width) - xCoord < width ? -width - 5 : 5;
 const yCoordShift =
   translateToNotScaled(seriesViewRect.height) - yCoord < height ? -height : 5;
 svgAnnotation.xCoordShift = xCoordShift;
 svgAnnotation.yCoordShift = yCoordShift;
};
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.