Pre loader

Cross Cursor in a candlestick chart

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


Greeting, I want to do a custom cursor, something just like the image, but with candles (a candlestick chart) , and I wanna see all the info (Date, open, close, high, low). Is there any example of it?

  • You must to post comments

Hi Kevin,

Thanks for your question.

Unfortunately we don’t have example of custom series tooltip for candlestick series but it shouldn’t be very hard to build it. Just need to extend another classes ( instead of DefaultXySeriesInfoProvider and XySeriesTooltip classes need to extend DefaultOhlcSeriesInfoProvider and OhlcSeriesTooltip because candlestick series accepts OHLC data ). All required data is provided by OhlcSeriesInfo instance ( Date if you’re using date or category date XAxis and OHLC values ). Here is a code:

class CustomOhlcSeriesInfoProvider extends DefaultOhlcSeriesInfoProvider {
    protected ISeriesTooltip getSeriesTooltipInternal(Context context, OhlcSeriesInfo seriesInfo, Class<?> modifierType) {
        if(modifierType == CursorModifier.class) {
            return new CustomOhlcSeriesTooltip(context, seriesInfo); // return custom tooltip for CursorModiifer
        } else {
            return super.getSeriesTooltipInternal(context, seriesInfo, modifierType);

    private static class CustomOhlcSeriesTooltip extends OhlcSeriesTooltip {

        public CustomOhlcSeriesTooltip(Context context, OhlcSeriesInfo seriesInfo) {
            super(context, seriesInfo);

        protected void internalUpdate(OhlcSeriesInfo seriesInfo) {
            // define tooltip text
            final SpannableStringBuilder sb = new SpannableStringBuilder();

            if (seriesInfo.seriesName != null) {
            sb.append("Date: ").append(seriesInfo.getFormattedXValue());
            sb.append("Open: ").append(seriesInfo.getFormattedOpenValue());
            sb.append("High: ").append(seriesInfo.getFormattedHighValue());
            sb.append("Low: ").append(seriesInfo.getFormattedLowValue());
            sb.append("Close: ").append(seriesInfo.getFormattedCloseValue());

            // set text to display by tooltip

            // set tooltip colors

Then like with line series you need to assign custom series info provider when you’re creating candlestick series:

  final FastCandlestickRenderableSeries candlestickSeries = sciChartBuilder.newCandlestickSeries()
            .withSeriesInfoProvider(new CustomOhlcSeriesInfoProvider())
            // other series configuration

Hope this will help you!

Best regards,

  • You must to post comments
Showing 1 result