I’m trying to add custom layout to the tooltip modifier ,but i couldn’t find the solution , also i would like to change the crosshair type behavior on the tool tip ,instead of that i would like to add my own style
- Vinu Gilbert asked 3 years ago
- You must login to post comments
i ‘ve tried the above mentioned solution, but couldn’t achieve the desired result.Here i’m attaching the design which i tried to implement.is there a way to pass it as a layout resource.It would be a great help if you could look into this
- Vinu Gilbert answered 3 years ago
-
Hi Vinu, Currently we don’t provide default implementation of tooltips which accept layouts for performance reasons. Default implementation is based on TextView because its layout is signle View, so it shouldn’t affect layout performance because of constant updates in chart. Of course you can create tooltip which consists of many Views, but to do this you’ll need to extend one of ViewGroups which you want to use as root for tooltip and implement ISeriesTooltip interface(https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.visuals.renderableSeries.tooltips.ISeriesTooltip.html) for it so it could be returned from custom SeriesInfoProvider for RenderableSeries. And this could be quite complex task to do. I would suggest to try to implement custom tooltip layout using Spannable(https://developer.android.com/reference/android/text/Spannable) which allows to modify how text is rendered by TextView or you can try to implement desired text as HTML and then set it as text for TextView(https://developer.android.com/reference/android/text/Html.html#fromHtml%28java.lang.String%29). Also you can always extend and override onDraw ( https://developer.android.com/reference/android/view/View#onDraw(android.graphics.Canvas) ) and implement custom drawing logic.
- You must login to post comments
Hi Vinu,
We have an example to show how to customize TooltipModifier tooltip. You can use it as a start point to customize tooltip in your application
Regarding custom crosshair for TooltipModifier – we provide constructor overload, which accepts CrossDrawableBehavior instance. You can extend this behavior and override its onDrawOverlay implementation and draw something custom on Canvas. The point where center of crosshair should be rendered is stored in lastUpdatePoint field.
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 3 years ago
- You must login to post comments
Please login first to submit.