浮动条形图刻度线不显示
我的数据:
var data5 = [
{ label: "my cat", data: [[1,10], [4,20], [7,30]], color: 'rgb(85, 96, 42)'},
{ label: "my job", data: [[2,30], [5,20], [8,30]], color: '#42215F'}
];
我的选项:
var type = {};
type[charttype] = {show: true};
type["xaxis"] = {ticks: [[1,"foo"], [2,"bar"], [4,"cat"], [5,"woo"], [7,"cookie"], [8,"yay"]]};
var chart_options = {};
chart_options["series"] = type;
但是,当我
var plot = $.plot($(div), data5, chart_options);
刻度线仅显示为 1-9,而不是我给出的字符串时。 我做错了什么?
my data:
var data5 = [
{ label: "my cat", data: [[1,10], [4,20], [7,30]], color: 'rgb(85, 96, 42)'},
{ label: "my job", data: [[2,30], [5,20], [8,30]], color: '#42215F'}
];
my options:
var type = {};
type[charttype] = {show: true};
type["xaxis"] = {ticks: [[1,"foo"], [2,"bar"], [4,"cat"], [5,"woo"], [7,"cookie"], [8,"yay"]]};
var chart_options = {};
chart_options["series"] = type;
however, when I
var plot = $.plot($(div), data5, chart_options);
The ticks just show up as 1-9, instead of with the strings I've given.
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Demo
charttype
替换为实际类型(线/点.. )xaxis
不应位于series
对象内部,而应位于同一级别。Try this:
Demo
charttype
is replaced with an actual type (lines/points..)xaxis
should not be inside ofseries
object, instead on the same level.