This is a migrated thread and some comments may be shown as answers.

Retrieving current color for markers border?

1 Answer 56 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Michaël
Top achievements
Rank 1
Michaël asked on 14 Sep 2015, 01:04 PM

Hi,

I'd like to achieve the following effect for line markers, as attached. I cannot know in advance the colors as they are configured by the user, and there is multiple lines in the chart. It appears that the trick is to create a border of 2 pixels of the marker, the problem is that the color must be "the line color". And while the marker background inherit the line color, there is no way to retrieve the line color and set it as a background.

Is there a workaround? It would be nice to add a specific keyword for color, so that it basically means "the current chart color".

 thanks!

 

1 Answer, 1 is accepted

Sort by
0
Michaël
Top achievements
Rank 1
answered on 14 Sep 2015, 01:17 PM

Hi,

 I've actually found a solution. You can use the function way to specify color, and retrieve it from the series option:

highlight: {
          markers: {
            border: {
              width: 2,
              color: function(e) {
                return e.series.color;
              }
            }
          }
        }

Tags
Charts
Asked by
Michaël
Top achievements
Rank 1
Answers by
Michaël
Top achievements
Rank 1
Share this question
or