We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义了dataView的显示,并提供了数据下载,但是无法复制数据视图的文本 怎样启用文本复制功能?
coffee script 编译后的代码如下 dataView: { readOnly: false, optionToContent: function (opt) { var cell, csv, csvContent, encodedUri, head, i, j, k, len, line, lines, link, ref, s, tr, tr_list, value, x, y; x = opt.yAxis[0].data; y = [ (function () { var k, len, ref, results; ref = opt.series; results = []; for (k = 0, len = ref.length; k < len; k++) { i = ref[k]; results.push(i.name); } return results; })() ]; y[0].splice(0, 0, "#"); value = [ (function () { var k, len, ref, results; ref = opt.series; results = []; for (k = 0, len = ref.length; k < len; k++) { i = ref[k]; results.push(i.data); } return results; })() ][0]; tr = ""; csvContent = "data:text/csv;charset=utf-8,%EF%BB%BF"; csv = y[0].join(",") + ",\n"; head = '<tr>'; ref = y[0]; for (k = 0, len = ref.length; k < len; k++) { i = ref[k]; head += '<th>' + i + '</th>'; } head += "</tr>"; tr_list = []; i = 0; lines = []; while (i < value[0].length) { j = 0; tr = ""; tr += "<tr>"; tr += "<td>" + x[i].replace(/,/g, " ") + "</td>"; line = x[i].replace(/,/g, ' '); while (j < value.length) { cell = value[j][i]; tr += "<td>" + cell + "</td>"; line += ", " + cell; j += 1; } line += "\n"; tr += "</tr>"; i += 1; lines.push(line); tr_list.push(tr); } csv += lines.reverse().join(""); encodedUri = csvContent + encodeURI(csv); link = "<a style='margin-left:20px' target='_bank' download='精选视频.csv' href='" + encodedUri + "'>点我下载</a>"; s = '<table class="table table-condensed"><thead>' + head + '</thead><tbody>' + tr_list.reverse().join(" ") + '</tbody></table>'; return link + s; } },
The text was updated successfully, but these errors were encountered:
我把值放在了input框里了 😂
Sorry, something went wrong.
不过还想知道有没有其他的办法?
请问还有其它比较好的解决方案吗?
No branches or pull requests
One-line summary [问题简述]
自定义了dataView的显示,并提供了数据下载,但是无法复制数据视图的文本
怎样启用文本复制功能?
Version & Environment [版本及环境]
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
Other comments [其他信息]
The text was updated successfully, but these errors were encountered: