How I can set Labels on bars?

74 views
Skip to first unread message

Alexey Shevchenko

unread,
Jul 30, 2020, 9:35:17 AM7/30/20
to Flot graphs
I switch properties:
series: {
    // stack: stack,
    bars: {
        show: bars,
        barWidth: 0.6,
        lineWidth: 0,
        zero: false,
        fill: 0.7,
        align: "center",
        dataLabels: true,
        labelColor: "#000000", // default is black
        labelBold: false, // set to make the label bold
        labelLoc: "center" // top or center
    }
},

Why doesn't it work?

atm.g...@gmail.com

unread,
Sep 22, 2020, 4:31:44 PM9/22/20
to Flot graphs
So, to be clear, the bar rendering options do not support rendering labels. Are you asking how you can extend the existing bar rendering options to support the ones you've created in your above snippet? If so, I would imagine you need to create a plugin, and implement the 'drawSeries' (or 'draw'?) method, that could render whatever additional visuals you require. The jquery.flot.errorbars.js plugin is a good example of how you can render additional visuals by adding options to the existing set.

Ced

unread,
Sep 22, 2020, 7:31:18 PM9/22/20
to Flot graphs
This plugin exists, though it was designed for an older version of Flot.
Reply all
Reply to author
Forward
0 new messages