- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试制作一个堆叠柱形图来表示时间轴上的事件。我需要间隔均匀的条形图,它们会随着各自的刻度向左/向右滚动。目前在滚动时,列保持不变,并且它们的数据被更新以反射(reflect)它们代表的新时间跨度(我假设)。
例如:向右滚动一个“步”时,我注意到这些差异:
该列保留在原位并更新数据,轴刻度向左移动。这会在滚动时产生类似“图形均衡器”的效果。 (参见 fiddle)
我需要的是让该列在图表的生命周期内代表相同的数据,并使用其刻度线向左/向右滚动。
我怀疑我误解了配置中的某些内容。非常感谢任何帮助/指导。
(附带说明:是否有任何简单的方法可以使过去的数据(xAxis 日期时间值为 < 今天)的样式/颜色与普通数据不同?)
chart: {
alignTicks: false,
backgroundColor: '#eeeeee',
events: {
load: function (e) {
this.xAxis[0].setExtremes(1390943153305, 1400015153305);
}
},
ignoreHiddenSeries: true,
renderTo: $('#chart')[0]
},
colors: ['#89f1a4','#68d9f7','#9eb9ef','#c49eef'],
credits: {enabled: false},
legend: {
enabled: true,
shadow: true
},
rangeSelector: {selected: 1},
title: {text: 'Global Events'},
navigator: {
height: 40,
xAxis: {
gridLineWidth: 1
},
series: {type: 'column'}
},
plotOptions: {
series: {
showInLegend: true,
stacking: 'normal',
dataGrouping: {
enabled: true,
forced: true,
units: [
['millisecond', [604800000]], // Attempting to force data into weekly groups, throws error if this is null
['second', [604800]],
['minute', [10080]],
['hour', [168]],
['day', [7]],
['week', [1]], // Expected this to be the only required option if I only want weekly grouping...
['month', null],
['year', null]
]
}
}
},
xAxis: {ordinal: false},
series: data
最佳答案
如果您只想每周分组,那么只有那一组,请参阅:http://jsfiddle.net/s6BmC/2/
我认为这可以解决您的问题,对吗?
plotOptions: {
series: {
showInLegend: true,
stacking: 'normal',
dataGrouping: {
enabled: true,
forced: true,
units: [ [ 'week', [1] ]]
}
}
},
关于附加问题:- 是的,你可以为每个点设置特定的颜色,但你需要自己确定应该设置什么颜色:
data: [{ x: timestamp, y: value, color: color }, { x: timestamp, y: value, color: color }... ]
另一种解决方案是为列包装设置颜色。我为烛台做了类似的事情:http://jsfiddle.net/79WZM/ (此解决方案需要更多的 Highcharts 知识)。
关于javascript - Highstock 柱形图 - 数据分组导致数据独立于轴滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21740313/
我正在使用高库存图表(时间线图表)并在没有数据的情况下加载 60,000 个数据点分组图表的宽度和高度为 800 和 400。可能吗? 最佳答案 您可以禁用 http://api.highcharts
我有一个 highstock图表。例如,在该图表中,我想为用户可能输入的目标设置一条情节线。 yAxis: { plotLines: [{ value: 100
我有一个问题 我已经能够在 JFiddle 上复制 .链接:http://jsfiddle.net/h5sSR/ $(function() { var chart = new Highcharts.S
如何将 javascript Date 转换为 highstock 数据?这是来自 highstock 示例的数组: [ /* Nov 2008 */ [1227830400000,13.24], /
我想在 HighChart 中显示多年的历史股票数据。多年来的json数据大小为5mb,为什么我想避免一次加载。特别是因为大多数用户只需要最近 6 个月。 我想最初获取前 6 个月。如果用户缩小或及时
我在使用 highstock.js 时遇到问题 没有明显的原因,它似乎在生成图表时将日期偏移了一半。 发生这种情况是因为 3 月 25 日的日期在图表中显示两次,x 轴上的第二个条目的值为 0。没有数
HighStock 中的数据分组允许我们从一组点中得出一个唯一值的近似值。 文档说一些预先构建的近似函数可用: “average”、“open”、“high”、“low”、“close”和“sum”
如何在 Highstock(不是 Highcharts!)中显示日期的周数? 我的 SQL 是这样的 select unix_timestamp(date)*1000 week (....) grou
这个问题是由数小时谷歌搜索 highstocks、zoom、extremes、ranges 以及所有其他可能的单词变体产生的,所有这些都会导致高图表答案的自定义函数出现一些变化。 有没有一种方法可以在
我正在尝试在Highstock中将lazy loading与dynamically updated data结合起来。这个想法是要有一个庞大的历史记录(包括数百万个数据点),并且要实时更新(如果用户滚
当您将 xAxis 定义为“dateTime”类型时,工具提示应将其识别为“point.x”值并将其转换为 DateTime 格式。 xAxis: { title: {
我的工具提示有问题,它不反射(reflect)图表的数据系列。它在图表显示不同内容的地方显示 0 值。 它看起来是这样的: 我创建了JSFIDDLE这表明了问题。 要重现此情况,您需要将范围选择器移动
一直在努力将数据从数组转移到图表中。这是我的代码, $(document).ready(function () { $.ajax({ type: "P
我的 Angular 应用程序出现问题。我必须创建一个包含多个系列的图形,并显示带有 x 和 y 值以及与 x 和 y 不同的点 id 的工具提示。 为了收集数据,我创建了一个点对象数组,如下所示:
我试图在页面的三个选项卡中的每一个上显示不同的图表。第一个选项卡可以完美呈现,但第二个和第三个选项卡则不然。 Example of first chart ok Example of second a
我制作了一个自定义的tickPositioner(在xAxis下),并且我想在放大时动态更改它。我尝试通过以下方式添加setExtremes事件来做到这一点: xAxis: {
我必须使用共享格式的工具提示,如何获取我悬停的点的索引?我已经尝试过其他建议的堆栈溢出解决方案,但没有任何效果。 tooltip: {useHTML: true, shared: true, form
我正在创建一个 Highstock 图表来显示每天收到的电子邮件数量。我有一个每天更新的 JSON 文件,如下所示: [{ "name": "Month", "data": [147199320000
我有一个包含一列复选框的数据表。以及 HighStock 图表。我试图做到这一点,以便当选中数据表中的相应复选框时,它会显示/隐藏图表上相应的系列线以及该线正在使用的轴。 表:
我试图通过单击绘图区域并拖动光标来在简单的 highstock 图表上实现平滑平移。 我注意到,如果我的数据没有时间戳,它会很好地工作: data: [-25.1,-23.8,-19.9,-19.1,
我是一名优秀的程序员,十分优秀!