Axis label in Flot

后端 未结 9 1368
长情又很酷
长情又很酷 2021-01-31 14:15

Does anyone know how one can set the label or title of an axis in Flot?

I\'ve read the API but it doesn\'t seem to have that feature...

Thanks :)

9条回答
  •  無奈伤痛
    2021-01-31 15:00

    I use szpapas idea.

    I added more jquery code below it to overwrite x-axis like this.

                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(1)').html("Berhad")
                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(2)').html("")
                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(3)').html("Sdn Bhd")
                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(4)').html("")
                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(5)').html("Enterprise")
                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(6)').html("")
                $('div.flot-x-axis div.flot-tick-label.tickLabel:nth-child(7)').html("Koperasi")
    

提交回复
热议问题