Prajjwal
Posts: 1
Joined: Mon Sep 20, 2021 3:23 pm

Add custom shapes to dumbbell lines.

Hey,
I am looking to add a triangle as shown in the image to the dumbell line. I actually want to show the direction of change. Is it possible to do so? If not, any suggestions for showing the direction of change?Image
Attachments
Screen Shot 2021-10-13 at 14.31.44 PM.png
Screen Shot 2021-10-13 at 14.31.44 PM.png (12.93 KiB) Viewed 216 times
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Add custom shapes to dumbbell lines.

Hello Prajjwal,

Welcome to our forum and thanks for contacting us with your question!

Unfortunatelly it is not possible to add such shape purely from API. There are few options that you might want to consider though.

First and probably most consistent one is to change dumbbell markers based on the trend. You can do it with option such as marker.shape and marker.fillColor.
Demo:https://jsfiddle.net/BlackLabel/yt6hf1b0/
API reference: https://api.highcharts.com/highstock/se ... ker.symbol,
https://api.highcharts.com/highstock/se ... .fillColor

Second option is to add second scatter series which would overlap with dumbbell showing the trend.
Demo: https://jsfiddle.net/BlackLabel/tv1p9e5c/

Last option is to use SVGRenderer which allows you to draw custom shapes on the chart. This is a good option too but will most likely require more work than previous two because you have to find right positions based on the points to render custom shapes.
API reference:https://api.highcharts.com/class-refere ... VGRenderer

Let me know if that was what you were looking for!
Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”