如何设置轴/刻度标签标签的格式?
如果我需要更改字体样式和字体大小怎么办?
我提到了以下问题,但没有成功:
Tickformatter not performing as expected in latest version of Flot
请帮助!!!
日Thnx。
答案 0 :(得分:5)
如果您使用的是0.8,请在样式表中覆盖.flot-tick-label
。您可以通过flot- [x | y] -axis类获得更具体的信息。
有关详细信息,请参阅文档的customizing the axes部分。
答案 1 :(得分:2)
我使用了以下内容:
CSS文件/ SCSS文件
#graph_label .tickLabel{
font-size: 50%;
}
Index.html或您正在绘制图表区域的地方
$.plot($("graph_label"), [dataArrayReference], options);
PS:我在0.8.1之前使用的是Flot Version,所以我对最新版本的工作方式不了解
答案 2 :(得分:0)
对于我来说,我已经通过以下方式解决了该问题:
var _chart = $.plot($(element).find('[flot-placeholder]'), dataset, chartOptions);
$(element).find('.tickLabel').css('color', 'blue'); // fix