我正在使用这个功能
chart.yAxis2.tickFormat(function(d) { return '$' + d3.format(',f')(d) });
Run Code Online (Sandbox Code Playgroud)
为了将美元符号和货币格式附加到我的 y 轴之一。
是否可以在工具提示中显示美元符号和货币格式?
这是我的图表:http : //codepen.io/neonpulp/pen/zBZgrv。下面也是代码。提前致谢!
function buildGraph(){
//this will hold of our main data consists of multiple chart data
var data = [];
//variables to hold monthly month
var monthList = ['Ene 2016','Feb 2016','Mar 2016','Apr 2016','May 2014','Jun 2016','Jul 2016','Aug 2016', 'Sep 2016', 'Oct 2016', 'Nov 2016', 'Dec 2016'];
var monthlyIncome = [0, 2757820, 3447270, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var companiesNumber = [0, 4, …Run Code Online (Sandbox Code Playgroud) 我有这个代码隐藏了一个只包含一个特定单词的div,我一直在尝试(没有运气)隐藏任何包含这个单词的div,但也包含更多文本.
任何帮助将不胜感激,谢谢!
let divs = document.getElementsByClassName('test');
for (let x = 0; x < divs.length; x++) {
let div = divs[x];
let content = div.innerHTML.trim();
if (content == 'example') {
div.style.display = 'none';
}
}Run Code Online (Sandbox Code Playgroud)
<div class="test">
ipsum
</div>
<div class="test">
example
</div>
<div class="test">
example complete
</div>Run Code Online (Sandbox Code Playgroud)