gpt4 book ai didi

javascript - Jquery Flot 图表标签未显示

转载 作者:行者123 更新时间:2023-12-03 10:26:02 25 4
gpt4 key购买 nike

所以我正在学习流程图,但在使用选项时我很难显示标签或图例。某些选项可以工作(例如线条的 fill 和 fillColor),但其他选项不行? 用头撞 table

由于某种原因,它根本没有出现在 jsfiddle 中,但它出现在我的网络应用程序中。

<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 轴添加标签。

关于javascript - Jquery Flot 图表标签未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29399889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com