tic
tic

Reputation: 4199

Increase different marker sizes when hovering series using highcharts

I have a scatter chart in Highcharts that have the last point marker in each series bigger than previous ones:

series: [{
    name: 'A',
    color: "#b0b0b0",
    data: [[38,42],[39,39],[35,45],[35,54],{x:36,y:35,marker:{radius:8,symbol:'circle'}}
    ]
}, {
    name: 'B',
    color: "#b0b0b0",
    data: [[46,56],[47,67],[48,69],[50,55],{x:52,y:57,marker:{radius:8,symbol:'circle'}}
    ]
}]

Then I have set to enlarge by 2 pixels the markers when hovering the series:

plotOptions: {
    scatter: {
        lineWidth:1,
        marker: {
            radius: 1,
            symbol:'circle',
            fillColor: '#800000',
            states: {
                hover: {
                    enabled: true,
                    radius:0,
                    radiusPlus:2,
                    lineColor: '#ff0000',
                    fillColor: '#ff0000'
                }
            }
        },
...
},

Working example is here. However, when I hover the series the last point marker becomes smaller and not bigger. How can I solve?

Upvotes: 4

Views: 2087

Answers (1)

Halvor Holsten Strand
Halvor Holsten Strand

Reputation: 20536

One solution is to add a specific hover radius to points that have a specific radius.

For example, your code works for all points except:

{x:36,y:35,marker:{radius:8,symbol:'circle'}

You could add the hover radius to this point declaration like this:

{x:36,y:35, marker:{radius:8,symbol:'circle', states: { hover: { radius: 10 } }}}

See this JSFiddle demonstration of how it looks.

Upvotes: 1

Related Questions