2015-07-19 116 views
0

这是我目前在我的图中使用的代码,我的问题是,我似乎无法格式化工具提示,以便只出现一个X轴值,您可以在下面的图像中看到,基本上我'我喜欢完全控制X和Y点的发布方式,现在我得到了一个不请自来的X轴客人。我似乎无法找到这个系统和任何可以解释为什么会发生这种情况或如何阻止它的例子之间的合理区别。如何格式化HighChartsJS工具提示使其仅显示一个X轴?

https://drive.google.com/file/d/0B9EllFfWHFFVT1JaMEp4ZG9xYXc/view 遗憾不得不张贴的外部形象,因为我花太少时间在这里...

  //call in the quants 
      $(function() { 
       $('#container1').highcharts({ 
        chart: { 
         type: 'area' 
        }, 
        title: { 
         text: 'Cost Of Program' 
        }, 
        subtitle: { 
         text: 'Price of The Program' 
        }, 
        xAxis: { 
         title: { 
          enabled: true, 
          text: 'Weeks ' 
         }, 
         categories: xAxis 
        }, 
        yAxis: { 
         title: { 
          text: 'Cost' 
         }, 
         plotLines: [{ 
          value: 0, 
          width: 1, 
          color: '#808080' 
         }] 
        }, 
        tooltip: { 
         pointFormat: 'Weeks In: {point.x}, {series.name}: {point.y}' 
        }, 
        plotOptions: { 
         area: { 
          pointStart: 0, 
          marker: { 
           enabled: false, 
           symbol: 'circle', 
           radius: 2, 
           states: { 
            hover: { 
             enabled: true 
            } 
           } 
          } 
         } 
        }, 
        series: [{ 
         name: 'Money Youll Win Back If You Quit', 
         data: winMoney 
        },{ 
         name: 'How Much Youll Lose If You Quit', 
         data: loseMoney 
        }, { 
         name: 'Cost of the Program (cumulative)', 
         data: ourFee 
        }] 
       }); 
      }); 
     } 

回答

0
tooltip: { 
    pointFormat: 'Weeks In: {point.x}, {series.name}: {point.y}', 
    headerFormat: "" 
}, 
+0

真棒修复,谢谢! –

相关问题