0
我想刪除Dygraph函數的參數(主要是日期的長行),因爲它們是圖上的點。直到現在,我還在使用findAll函數來抓取其他類型的標籤,然而,看起來我需要深入探究這個問題。如何在javascript html標籤內部刮取JavaScript函數的參數?
<script type="text/javascript">
g = new Dygraph(
// containing div
document.getElementById('DailySubscribers'),
// CSV or path to a CSV file.
"Date,Daily Subs\n" + "2016-07-31,1\n" + "2016-08-01,1\n" + "2016-08-02,0\n" + "2016-08-03,1\n" + "2016-08-04,0\n" + "2016-08-05,2\n" + "2016-08-06,10\n" + "2016-08-07,5\n" + "2016-08-08,1\n" + "2016-08-09,1\n" + "2016-08-10,2\n" + "2016-08-11,0\n" + "2016-08-12,0\n" + "2016-08-13,0\n" + "2016-08-14,0\n" + "2016-08-15,1\n" + "2016-08-16,1\n" + "2016-08-17,0\n" + "2016-08-18,0\n" + "2016-08-19,1\n" + "2016-08-20,0\n" + "2016-08-21,1\n" + "2016-08-22,0\n" + "2016-08-23,0\n" + "2016-08-24,7\n" + "2016-08-25,2\n" + "2016-08-26,0\n" + "2016-08-27,1\n" + "2016-08-28,1\n" + "2016-08-29,0\n" + "2016-08-30,0\n" + "2016-08-31,0\n" + "2016-09-01,0\n" + "2016-09-02,0\n" + "2016-09-03,0\n" + "2016-09-04,0\n" + "2016-09-05,1\n" + "2016-09-06,0\n" + "2016-09-07,0\n" + "2016-09-08,0\n", {
title: 'Daily Subs Gained for UCZx2vmIsQQLwzqwGWUbfqQA ',
legend: 'always',
ylabel: 'Daily Subs',
titleHeight: 20,
labelsDivStyles: {
'background': 'none',
'margin-top': '-10px',
'text-align': 'right',
},
strokeWidth: 1,
colors: ["#dd2323",
"#dd2323",
"#dd2323",
"#dd2323"],
labelsKMB: true,
maxNumberWidth: 10
}
);
</script>
什麼是你想要的值。? –
我想提取日期,日常子\ n「+」2016-07-31,1 \ n「+」2016-08-01,1 \ n「....這些值 –
因此,您想要提取該行直到'2016-09-08,0 \ n「,{'是否正確? – chad