Flot With “String” x-axis

前端 未结 3 1136
礼貌的吻别
礼貌的吻别 2020-12-24 05:07

When using flot I would like to have a string based x-axis. For example I have a list of customers \"Bob\", \"Chris\", \"Joe\" and would like to plot their revenue on the Y-

3条回答
  •  醉梦人生
    2020-12-24 05:30

    The Categories plugin (jquery.flot.categories.js) will do this quite nicely, so that data can be formatted like this:

    var data = [ ["January", 10], ["February", 8], ["March", 4], ["April", 13], ["May", 17], ["June", 9] ];
    

    and plot like this: enter image description here

    See: http://www.flotcharts.org/flot/examples/categories/index.html

提交回复
热议问题