Jquery浮动图表标签未显示
Jquery Flot Chart label not showing
所以我正在学习flot图表,但在使用选项时,我很难显示标签或图例。某些选项会起作用(比如线条的填充和fillColor),但其他选项不行把头撞在桌子上
出于某种原因,它根本没有出现在jsfiddle中,但它出现在我的web应用程序中。
<h1>Flot Examples</h1>
<div id="placeholder" class="placeholder" style="width:500px; height:300px; background-color:darkcyan;" runat="server">
<script type="text/javascript">
var data, data1, dataTime, options, chart;
var date = new Date(); //2015
var date1 = date.setDate(date.getDate());
var date2 = date.setDate(date.getDate() - 365); //2015
var date3 = new Date(date.getFullYear() - 2, date.getMonth() - 5, date.getDate() - 6);
dataTime = [
[date1, 1],
[date2, 3],
[date3, 6]
];
data2 = [dataTime];
data1 = [
[1, 4],
[2, 5],
[3, 6],
[4, 9],
[5, 7],
[6, 6],
[7, 2],
[8, 1],
[9, 3]
];
data = [data1];
options = {
series: {
//bars: { show: true }
lines: {
show: true,
// fill: true,
//fillColor: "#000000"
},
},
xaxis: {
mode: "time"
},
yaxis: {
min: 1
},
selection: {
mode: "x"
},
grid: {
show: true
},
// clickable: true,
// hoverable: true,
shadowSize: 20,
highlightColor: "#ffffff", //this is the color of the circle that appears
label: {
string: "invisible"
},
tooltip: true,
legend: {
show: true,
labelBoxBorderColor: "#ffffff",
position: "ne",
margin: 10,
backgroundColor: "#66ccff",
}
};
$(document).ready(function() {
// chart1 = $.plot($('<%= placeholder.ClientID %>'), data, options);
chart1 = $.plot($(".placeholder"), data2, options);
});
</script>![enter image description here][1]
我建议使用这个轴标签插件:https://github.com/markrcote/flot-axislabels.它可以让你为x和y轴添加一个标签,非常简单。
相关文章:
- 如何使多个标签显示在JQuery范围滑块中
- 如何使用 JavaScript 向我的
标签显示图像
- DIV 标签显示:内联块;
- 安卓上的html5视频标签显示黑屏
- 高图表.js如何强制 x 轴标签显示所有月份,无论图表大小如何
- 如何在javascript中将服务器端标签显示更改为Block
- 为什么用Javascript RegEx在文本周围包装标签会将标签显示为文本
- 锚点标签显示完整链接问题
- 如何通过按下标签显示隐藏内容使用选择器
- Internet Explorer中的选项标签显示块/无
- js标签显示所有菜单项的最后一个条目的标签
- 过滤一个html页面,所以只有某些标签显示
- 使用angularjs和ionic通过html img标签显示图像
- Sencha不能在控制器中触发我的标签显示事件
- 用html标签显示javascript变量值
- jQuery进度条标签显示“false”
- Highcharts响应式数据标签显示
- 检测标签显示,移除类隐藏
- ZingChart x轴标签显示为数字而不是字符串
- 需要帮助在Div标签显示曲线边界以上的Img