dygraph 1.1.1似乎错误地检测到数据源的范围值(dygraph 1.1.1 appears to incorrectly detect range value for data source)
我一直在努力想弄清楚如何让dygraphs与我的数据很好地配合。 当它渲染图表时,它会切断显示屏中的大部分线条。 但是,如果我向左侧滚动(移动+拖动),它会重新缩放视图并包含所有数据。 看起来图表末尾的下降正在扭曲图表的视图。
这很简单,我在这里有一个示例数据文件: http : //pasamio.com/~pasamio/dygraph/sample_data.json
而这就是我用来吸引它的内容:
var dataURL = "http://pasamio.com/~pasamio/dygraph/sample_data.json"; var jsonData = null; var jsonDataResult = $.ajax({ url: dataURL, dataType: "json", async: false, success: ( function(data) { jsonData = data; }) }); var data = new google.visualization.DataTable(jsonData); var g = new Dygraph.GVizChart(document.getElementById("dg_div")); g.draw(data, {"panEdgeFraction" : 0.1});
我在这里有一个示例jsfiddle,显示了坏的情况: https ://jsfiddle.net/g6b6jp9z/5/
任何想法都在这里发生了什么?
I've been struggling with trying to figure out how to get dygraphs to play nicely with my data. When it renders the chart, it cuts off a good chunk of the lines in the display. However if I scroll (shift + drag) to the left a little it rescales the view and includes all of the data. It looks like the drop off at the end of the graph is skewing the view of the chart.
It's really simple, I have a sample data file here: http://pasamio.com/~pasamio/dygraph/sample_data.json
And here's what I'm using to pull it in:
var dataURL = "http://pasamio.com/~pasamio/dygraph/sample_data.json"; var jsonData = null; var jsonDataResult = $.ajax({ url: dataURL, dataType: "json", async: false, success: ( function(data) { jsonData = data; }) }); var data = new google.visualization.DataTable(jsonData); var g = new Dygraph.GVizChart(document.getElementById("dg_div")); g.draw(data, {"panEdgeFraction" : 0.1});
I've got a sample jsfiddle here that shows the bad case: https://jsfiddle.net/g6b6jp9z/5/
Any idea's what's going on here?
原文:https://stackoverflow.com/questions/41412788
最满意答案
$select = mysql_query("SELECT * FROM news WHERE timestamp <= NOW() ORDER BY timestamp");
试试......
请记住 - 您的帖子暗示您没有使用时间戳。 您似乎使用了datetime数据类型。 我的回答适用于日期时间。
另外,我认为你的头衔是误导性的。 根据您的问题,您似乎正在排队,所以事情将在您提供的日期之前发布。 如果在将来,那么它在该日期之前不会显示该文章。
$select = mysql_query("SELECT * FROM news WHERE timestamp <= NOW() ORDER BY timestamp");
try that...
Keep in mind - your post suggests you're not using a timestamp. You appear to be using a datetime datatype. My answer would work for datetime.
Also, I think your title is misleading. By your question it looks like you're making a queue so things will be posted by the date you provide. If in the future, then it does not display the article until that date.
相关问答
更多-
你不能用Entity Framework来做这件事,因为它不允许时间戳比较中的>=运算符。 它只允许= 。 你可以做例如 var b = BitConverter.GetBytes(1000000L); var query = from x in MyTable where x.RowId = b; // not >= 但那不会很有用。 所以你必须找到另一种获得新行的方式,例如标识列中的值,或添加一个“真实”时间戳(日期时间)列。 You can't do this with En ...
-
我想我们可以用窗口函数来做到这一点: WITH Numbered AS ( SELECT *, --TODO, pick columns ROW_NUMBER() OVER (ORDER BY CASE WHEN timestamp < current_timestamp THEN timestamp ELSE '18000101' END desc) as HistoricRN, ROW_NUMBER() OVER (ORDER BY CASE WHEN t ...
-
假设您的Table_Logs表中的多个条目可能具有相同的时间戳,并且您希望返回最近输入的每个条目,则需要使用GROUP BY : SELECT Field1, Field2, Max(TimeStamp) maxTime FROM Table_Logs WHERE Account_Id = '12345' GROUP BY Field1, Field2 Field1等是您要在Table_Logs中返回的字段。 这里有一些示例SQL小提琴试用。 祝你好运。 Assuming you mean multipl ...
-
如何选择Timestamp date>或
or < other Timestamps?) [2023-01-15]用于从表中检索行的SQL语法是select ,而不是get : SLEECT * FROM items WHERE pubDate < ? The SQL syntax used to retrieve rows from a table is select, not get: SLEECT * FROM items WHERE pubDate < ? -
Jmeter - 未来的时间戳(Jmeter - Future timestamp)[2022-05-30]
我担心__time()函数不能提供足够的灵活性。 您需要通过Beanshell Sampler或Beanshell预处理器来计算此日期值 相关的Beanshell代码将如下所示 import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; Date now = new Date(); // get current time Calendar c = Calendar.getInstance(); / ... -
选择带时间戳的记录(Select records with timestamp)[2023-11-16]
试试PreparedStatement ( Javadoc ): PreparedStatement pstmt = connection.prepareStatement("select * from ... where time = ?"); pstmt.setTimestamp(1, timestamp); ResultSet rs = pstmt.executeQuery; Try PreparedStatement (Javadoc): PreparedStatement pstmt = con ... -
这里的解决方案: 样本数据: stackoverflow=# select * from test.dated_records ; dated_record_id | create_date | update_date --------------------+--------------------+-------------------------------- 1 | 2017-06-08 00:00:00+07 | 201 ...
-
使用MySQL表中的日期从时间戳行中选择不同的记录(Select Distinct records from a Timestamp row using day only from MySQL table)[2022-05-19]
您可能对order by有问题。 这个怎么样? SELECT DATE(event_date) FROM schedule WHERE event_date >= CURDATE() GROUP BY DATE(event_date) ORDER BY DATE(event_date) ASC LIMIT 4; You may have a problem with the order by. How about this? SELECT DATE(event_date) FROM schedule WH ... -
$select = mysql_query("SELECT * FROM news WHERE timestamp <= NOW() ORDER BY timestamp"); 试试...... 请记住 - 您的帖子暗示您没有使用时间戳。 您似乎使用了datetime数据类型。 我的回答适用于日期时间。 另外,我认为你的头衔是误导性的。 根据您的问题,您似乎正在排队,所以事情将在您提供的日期之前发布。 如果在将来,那么它在该日期之前不会显示该文章。 $select = mysql_query("SELEC ...
-
function time_ago($time) { $periods = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade'); $lengths = array('60', '60', '24', '7', '4.35', '12', '10'); $now = time(); // if($now > $time) { $difference = $now ...