Highcharts“区域”没有正确地徘徊

时间:2013-09-16 13:45:49

标签: javascript highcharts coffeescript

我正在使用Highcharts来显示我们每天获得的潜在客户数量: enter image description here 但是,当我将鼠标悬停在图表上时,它无法正常工作。查看鼠标的位置和信息框的位置。 enter image description here enter image description here

这是我的代码:

  if $('#swedbank_leads_per_day_graph').length > 0
  data = PageData.swedbank_leads_per_day
  swedbankLeadsPerDay = new Highcharts.Chart
    chart:
      renderTo: 'swedbank_leads_per_day_graph'
      type: 'area'
    title:
      text: null
    tooltip:
      formatter: ->
        date = new Date(this.x)
        return date.toDateString() + '<br />' + "#{this.y} lead(s)"
    xAxis: 
      type: 'datetime'
      # tickInterval: 24 * 3600 * 1000 # Days
    legend:
      enabled: false
    series: [
      data: data,
      pointRange: 24 * 3600 * 1000
    ]
    yAxis:
      title:
        text: 'Finance leads per day'

(注:使用Coffeescript)

使用列时,它可以正常工作。有什么提示吗?

1 个答案:

答案 0 :(得分:1)

您的数据未按xAxis排序 - 请确保您的值会提高。另外,我建议将Highcharts升级到3.0.5版本 - 然后在JS控制台中,您将收到包含未排序数据(以及更多其他数据)的错误消息。