Change color of bar on hover with FLOT charts

2019-07-03 22:01发布

问题:

Is it possible to change the color of a bar on hover with Flot horizontal bar charts

回答1:

This worked for me by setting the 'highlightColor' field:

$.plot("#placeholder", [data], {
    series: {
        bars: {
            show: true,
            align: 'center',
            barWidth: .6,
            horizontal: true
        },
        highlightColor: 'rgb(190,232,216)'
    },
    grid: {
        hoverable: true
    }
});

See this fiddle for working example.