简体   繁体   English

通过刷图返回Focus + Context的日期值

[英]return date value of Focus+Context via Brushing Chart

I am doing twitter sentiment analysis, where it will show the overall area graph and i would be able to select the range of dates and pick out all or some of the tweets that is within the range. 我正在做Twitter情绪分析,它将显示整个区域图,并且我将能够选择日期范围,并挑选出该范围内的所有或部分推文。

I am trying to generate a tweet box by using the date slider from the sub chart at Focus+Context via Brushing . 我试图通过使用Brushing从Focus + Context的子图表中使用日期滑块来生成一个tweet框。

I have the Focus+Context via Brushing working but i have no idea how to return the date value of the sub chart. 我有通过画笔工作的焦点+上下文,但我不知道如何返回子图表的日期值。

Date slider using Jquery seems to look good but the slider must affect the graph too and the tweetbox. 使用Jquery的日期滑块看起来不错,但是滑块也必须影响图形和tweetbox。

As the user "brushes" the sub chart you just want the date range of the selection? 当用户“刷”子图表时,您只需要选择的日期范围?

Look at the brushed function in the example: 查看示例中的brushed函数:

function brushed() {
  x.domain(brush.empty() ? x2.domain() : brush.extent());
  focus.select(".area").attr("d", area);
  focus.select(".x.axis").call(xAxis);
}

brush.extent is an array of two values, startDate and endDate of the selection. brush.extent是两个值的数组,即选择的startDate和endDate。 Here's a console.log of a random brush.extent : 这是一个随机brush.extentconsole.log

[Tue Mar 26 2002 20:46:48 GMT-0400 (Eastern Daylight Time), Fri Apr 18 2003 09:10:32 GMT-0400 (Eastern Daylight Time)]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM