简体   繁体   English

JQuery-Flot:如何为Y轴添加文本标签和为X轴添加日期标签?

[英]JQuery-Flot: How to add text label for Y-axis and date label for X-axis?

So basically, I have a test graph in JQuery-Flot, and instead of the normal integer axis. 基本上,我在JQuery-Flot中有一个测试图,而不是普通的整数轴。 I need to use text label for the Y-axis and date label for the X-axis. 我需要为Y轴使用文本标签,为X轴使用日期标签。 Do anyone know how to do this? 有谁知道怎么做?

The flot api covers both of these cases (under "Customizing the axes"). flot api涵盖了这两种情况(在“自定义轴”下)。 For the x-axis you'll want to use the "time" option . 对于x轴,您需要使用“时间”选项 For the y-axis tick labels you'll want to specify the ticks option (what text should appear at each location): 对于y轴刻度标签,您需要指定刻度选项(每个位置应显示的文本):

ticks: [[0, "zero"], [1.2, "one mark"], [2.4, "two marks"]] 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM