如何设置轴/刻度标签标签的格式?
如果我需要更改字体样式和字体大小怎么办?
我提到了以下问题,但没有成功:
Tickformatter在最新版本的Flot中没有按预期执行
请帮忙 !!!
日Thnx.
使用flot chart,我需要将背景分成两种颜色.它不会在中间,它会略有偏移.
至于我所看到的,我在互联网上找不到提供此信息的任何文件.如果有人能指出我正确的方向,这将是伟大的.如果有可能,有人可以将代码放入如何操作吗?
我在当前项目中正在做一些浮动图表。当您至少有一个具有正值的数据对象时,该代码会很好用,但是如果返回的数据为零,我希望至少显示一个空圆圈或某种消息或其他内容。这是我要制作图表的数据对象。图例显示正常,但没有图表(即使是空白图表)。
datacontent":[{"label":"Wired headset","data":0},{"label":"Bluetooth headset","data":0},{"label":"Car bluetooth","data":0},{"label":"None","data":0}]
Run Code Online (Sandbox Code Playgroud)
我真的很想只显示“对不起,没有可用的图表”之类的消息,同时仍显示图例。这可能吗?
这是当前显示的屏幕截图:

我需要使用Flot图表库创建图表,使用PHP JSON函数(即json_encode).
问题是我不理解PHP数组的结构,必须对其进行编码以创建适当的JS数组来生成Flot图表.
图表需要有几行,颜色不同.
有人可以帮我提供一些适当的PHP数组示例.
我试过(没有成功)实现下一个例子:
问题是我得到的对象我不知道如何在我的脚本中实现:
$.ajax({
type:'post',
dataType: "json",
url:'/stocks/index/',
success: function(r) {
$.plot($("#placeholder"), [
{data:(r)}
] )
}
});
Run Code Online (Sandbox Code Playgroud)
先感谢您!
更新:用于生成JSON数组的php代码如下所示:
$dataSet1 = array();
$dataSet1['label'] = 'Customer 1';
$dataSet1['data'] = array(array(1,1),array(2,2)); // an array of arrays of point pairs
$dataSet2 = array();
$dataSet2['label'] = 'Customer 2';
$dataSet2['data'] = array(array(3,3),array(4,5)); // an array of arrays of point pairs
$flots = array($dataSet1, $dataSet2);
return json_encode($flots);
Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的流程图设置为类似于以下内容:

这是我目前的图表:

这是我的图表代码,
<?php
include('Includes/connect.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf8"/>
<title>Index</title>
<script src="Includes/jquery-1.8.3.js"></script>
<script src="Includes/jquery.flot.js"></script>
<script src="Includes/jquery.flot.time.js"></script>
</head>
<?php
// Main query to pull data from 'tests' table
$sql = "SELECT UNIX_TIMESTAMP(`date`)*1000 AS unixDate,`date`, `test1`, `test2`, `test3`, `test4`, `test5`, `test6`, `test7`, `test8`, `test9`, `test10`, `test11`, `test12`, `test13`, `test14` FROM `tests` WHERE member_id = '1' ORDER by `date` ASC";
$result = mysql_query($sql) or die ("no query");
// Dataset1
while($row …Run Code Online (Sandbox Code Playgroud) 我正在使用flot库来制作地块.网站上给出的示例都有他们的javascript代码,如下所示:
<script>
$(function() {
...
...
... plot ...
});
</script>
Run Code Online (Sandbox Code Playgroud)
http://www.flotcharts.org/flot/examples/realtime/index.html
$(function(){})位是什么意思?