Google表格允许将任何电子表格发布到网络.这样做会公开已发布电子表格中包含的数据,以便通过各种API(例如Google表格API)进行访问.
除了一件事,这都是罚款和罚款.通过API访问已发布的工作表,返回已为该工作表提供的用户的电子邮件地址.
例如,像这样的请求:
https://spreadsheets.google.com/feeds/cells/[key]/[sheetId]/public/basic?alt=json
Run Code Online (Sandbox Code Playgroud)
除其他信息外,还将返回此信息:
"author": [ {
"name": {
"$t": "***"
},
"email": {
"$t": "***@***.com"
}
} ],
Run Code Online (Sandbox Code Playgroud)
将***以上代码片段是真实的谷歌帐户名和电子邮件.
有没有办法通过文档属性或通用通用Google帐户属性禁用通过公共API发布您的电子邮件地址?
我在Chrome上触摸屏过度滚动时遇到问题.
我有一个包含SVG元素的文档,其中包含一些形状,比如一个矩形:
现在,我想使矩形可拖动,这意味着我想<rect>通过设置它的样式属性来禁用相应元素上的各种触摸操作touch-action: none.
这适用于所有桌面浏览器,Chrome除外.在Chrome上,当我触摸并移动一个矩形时,浏览器的过度滚动功能就会启动.这会导致浏览器窗口笨拙地移动,以及我在矩形上设置的所有指针事件都被取消.
即pointermove注册了几分之一秒,然后当过度滚动开始时它就会停止.pointerup即使触摸被释放也不会被调用.
现在,如果我有一个HTML元素而不是一个SVG元素,那么设置touch-action: none就可以了.SVG元素上的相同内容失败.
从技术上讲,这可以通过两种设置来解决touch-action: none上document.body或包裹整个SVG成<div>与元素touch-action: none集.
不幸的是,这对我来说不是一个选项,因为我需要文档(以及围绕矩形的SVG的其余部分)来保留其所有原始触摸手势,除非直接在矩形上.
作为一种解决方案,我确实尝试在矩形touch-action: none上document: body发生pointerdown事件时动态设置.
// Get element
var o = document.getElementById( "test" );
// disable touch action on press of the SVG element
o.addEventListener( "pointerdown", function(e) {
document.body.style.touchAction = "none";
} );
// re-enable touch action when released
o.addEventListener( "pointerup", function(e) {
document.body.style.touchAction = "auto"; …Run Code Online (Sandbox Code Playgroud) 我使用amCharts制作一些图表,但由于所述图形中的数据量太大,动画滞后并消耗大量处理能力,这是不必要的.
我想知道是否有可能禁用amCharts序列图中的所有动画,如果是这样,怎么样?
我正在使用amCharts在我的表单中创建图表.我想创建一个分组的条形图.
我的JSON数据是:
[{date:'10-dec-2015',visits:4025,country:'USA'},{date:'10-dec-2015',visits:1182,country:'India'},{date:'10-dec-2015',visits:o,country:'Spain'},{date:'11-dec-2015',visits:1322,country:'USA'},{date:'11-dec-2015',visits:1122,country:'India'},{date:'11-dec-2015',visits:1114,country:'Spain'},{date:'12-dec-2015',visits:984,country:'India'},{date:'13-dec-2015',visits:711,country:'Poland'},]
Run Code Online (Sandbox Code Playgroud)
我现有的代码如下:
chartData = generateChartData(); //function call
//creating column chart
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": chartData,
"categoryField": "date",
"rotate": false,
"startDuration": 1,
"categoryAxis": {
"labelRotation": 90,
"gridPosition": "start",
"position": "left",
"autoGridCount": false,
},
"trendLines": [],
"graphs": [
{
"balloonText": "[[country ]]:[[value]]",
"fillAlphas": 0.8,
"id": "AmGraph-1"+i,
"lineAlpha": 0.2,
"title": "title",
"type": "column",
"valueField": "visits",
"color":colors[0]
}
],
"chartScrollbar": {
"autoGridCount": false,
"graph": "AmGraph-1"+i,
"scrollbarHeight": 10
},
"legend": {
"align": "center",
"position": "right",
"markerType": "square", …Run Code Online (Sandbox Code Playgroud) 我在使用 Google 字体的页面上显示了一个 SVG。
<text>SVG 上的节点很好地继承了 Google Font。
现在,我正在尝试使用Blob.
这是有效的,除了<text>使用安装在浏览器计算机上的后备“Verdana”而不是动态加载的 Google 字体“Pacifico”进行渲染。
window.onload = function() {
var width = 400;
var height = 100;
var DOMURL = self.URL || self.webkitURL || self;
var data = new XMLSerializer().serializeToString(document.getElementById("test"));
var svg = new Blob([data], { type: "image/svg+xml" });
var url = DOMURL.createObjectURL(svg);
var canvas = document.getElementById("result");
canvas.width = width;
canvas.height = height;
var ctx = canvas.getContext("2d");
var img = new Image(width, height);
img.onload = function() {
ctx.drawImage(img, …Run Code Online (Sandbox Code Playgroud)我正在尝试将类名添加到自定义项目符号中,因此我可以使用CSS定位它.我也试图为该自定义项目符号添加一个值.我不认为我在测量仪js中设置正确:
var chart = AmCharts.makeChart("maint-good", {
"type": "serial",
"rotate": true,
"theme": "light",
"path": "http://www.amcharts.com/lib/3/",
"autoMargins": false,
"marginTop": 80,
"marginLeft": 80,
"marginBottom": 30,
"marginRight": 50,
"addClassNames": true,
"dataProvider": [{
"marginTop": 80,
"category": "",
"excelent": 20,
"good": 20,
"average": 20,
"poor": 20,
"bad": 20,
"limit": 15,
"full": 15,
"bullet": 15,
"icon": "assets/img/icons/maint_good.svg",
"ok": "assets/img/icons/ok.svg"
}],
"valueAxes": [{
"maximum": 20,
"stackType": "regular",
"gridAlpha": 0
}],
"startDuration": 1,
"graphs": [{
"columnWidth": 0.6,
"lineColor": "#2F2F2F",
"lineThickness": 22,
"noStepRisers": true,
"stackable": false,
"type": "step",
"valueField": "limit", …Run Code Online (Sandbox Code Playgroud) 我正在尝试从<html>和<body>标签中读取"marginTop"样式属性.Chrome开发人员工具通过HTML-CSS显示设置的margin-top:
<style type="text/css" media="screen">
html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }
</style>
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试这样的事情时:
console.debug(document.getElementsByTagName('html')[0].style.marginTop);
console.debug(document.getElementsByTagName('body')[0].style.marginTop);
Run Code Online (Sandbox Code Playgroud)
在这两种情况下我都得到空字符串.
jQuery的offset()函数正确检测边距.不幸的是,在这种情况下我不能使用jQuery,它必须是纯JavaScript.
如果有人能够提供一些关于如何从html和body元素中读取top margin属性的信息,我将不胜感激.
我正在使用amCharts来准备条形图
请查看小提琴我的条形图如下:
我试图将Y轴的最大值设置如下:
我已添加此行来处理Y轴,如下所示:
valueAxis.autoGridCount = false;
valueAxis.gridCount = 10;
valueAxis.labelFrequency = 100;
Run Code Online (Sandbox Code Playgroud)
但没有得到.请指导我!
https://jsfiddle.net/f3zy3bjc/
我正在尝试将自定义标签添加到图表中每个条形的末尾,如下所示:
"graphs": [{
"balloonText": "<b>[[category]]: [[value]]</b>",
"fillColorsField": "color",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"type": "column",
"valueField": "visits",
"labelFunction": function(data) {return 'new label';}
}],
Run Code Online (Sandbox Code Playgroud)
labelFunction属性不起作用,我不知道为什么.