在条形图和折线图的x和y轴上仅放置整数-Flot [英] Put only integers in x and y axis of bar and line graphs - Flot

查看:74
本文介绍了在条形图和折线图的x和y轴上仅放置整数-Flot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Flot.js中,默认情况下,条形图和折线图以数字作为x和y轴上的坐标.

如何使坐标成为仅数字或至少可见的整数?

解决方案

因此,在图形选项中,您可以这样指定:

$.plot($('#placeholder'),data,{
   //your options,
   xaxis: {
      minTickSize: 1
   }
});

在此处查看其工作方式: http://jsfiddle.net/ryleyb/g2CTz/

In Flot.js, bar graphs and line graphs have numbers as the coordinates in the x and y axis by default.

How can you make the coordinates such that the numbers are only integers or at least only the integers are visible?

解决方案

Check out the minTickSize option from the documentation:

Alternatively, you can specify that you just don't want ticks at a size less than a specific tick size with "minTickSize".

So in your graph options, you would specify it like this:

$.plot($('#placeholder'),data,{
   //your options,
   xaxis: {
      minTickSize: 1
   }
});

See it working here: http://jsfiddle.net/ryleyb/g2CTz/

这篇关于在条形图和折线图的x和y轴上仅放置整数-Flot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆