我想知道如何防止在bootstrap的glyphicons中显示表情符号?
这个
<span class="glyphicon glyphicon-tent"></span>
Run Code Online (Sandbox Code Playgroud)
渲染到这个(歌剧,moz)

我偶然发现了这个问题:https: //apple.stackexchange.com/questions/41228/why-do-emoji-like-appear-when-i-use-safari-but-not-chrome
Unicode在这里:
http://www.fileformat.info/info/unicode/char/26fa/index.htm
解决方案:将Bootstrap更新到最新版本.
所以问题是图表标签太长且动态。有没有办法设置标签长度限制并在悬停时显示工具提示?
xAxes: [{
stacked: type === 'stacked',
scaleLabel: {
display: true,
labelString: interval ? `${i18n.t('chart.time')} (${i18n.t('chart.' + interval)})` : field.key
},
ticks: {
autoSkipPadding: 11,
maxRotation: 90,
minRotation: 0
}
}]
Run Code Online (Sandbox Code Playgroud)
当前输出看起来像这样。
当前解决方案 xD 只是将键修改为最大长度 18 并制作了静态排除列表。
const excludes = ['maakond', 'Maakond', 'district', 'District',
'province', 'Province', 'county', 'County'];
data.district.data.forEach(el => {
excludes.forEach(ex => {
el.key = el.key.replace(ex, '');
});
if(el.key.length > 18) {
el.key = el.key.substring(0, 20);
el.key = el.key + '.';
}
});
Run Code Online (Sandbox Code Playgroud) 我正在尝试映射非数字 y 和 x,但由于某种原因它不起作用。
例如
xLabels: ["January", "February", "March", "April", "May", "June", "July"],
yLabels: ['Request Added', 'Request Viewed', 'Request Accepted', 'Request Solved', 'Solving Confirmed'],
Run Code Online (Sandbox Code Playgroud)
当我尝试改变时:
data: ['Request Added', 'Request Viewed']
Run Code Online (Sandbox Code Playgroud)
和
data: [{x: "January", y: 'Request Added'}, ...]
Run Code Online (Sandbox Code Playgroud)
图表不显示任何东西
我也尝试使用 scales.yAxis.ticks.callback 来修改和映射数组,但这也没有奏效。
[0: 'Request Added', 1: 'Request Viewed']
Run Code Online (Sandbox Code Playgroud)
编辑:基本上我需要这样的东西
Request Added x x
Request Viewed x
Request Accepted x x
January, Feb, March
Run Code Online (Sandbox Code Playgroud)
基本上是一个副本:https : //answers.splunk.com/answers/85938/scatter-plot-with-non-numeric-y-values.html
这也建议映射到一个数组,但 Y-ticks 中的回调没有任何意义..?当我添加labelY : [1,2,3,4,5,6]回调“值”的第三个参数时,它等于[-2-1 0 1 2].
所以浏览器抛出
关于错误使用 momentJS 的警告。
Deprecation warning: value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 12.30, _f: false, _strict: undefined, _locale: [object Object]
Error
Run Code Online (Sandbox Code Playgroud)
所以我查看了我的代码
data: {
labels: ['01.01', '02.01', '03.01', …Run Code Online (Sandbox Code Playgroud) 当我创建一个记录const myRecord = this.store.createRecord('myType', myObject),然后myRecord.save()请求通过适配器发送到服务器.数据已成功保存,服务器将所有数据返回给客户端.它通过序列化器返回,通过normalize()钩子.
问题是Ember不会myRecord使用从服务器返回的属性更新对象,例如id或version...
当我刷新页面时,所有属性都在那里(当然).
我有更新记录的类似问题.我的应用程序中的每条记录都有一个版本属性,由服务器检查.每次保存时都会增加版本.这是为了数据安全.问题是,当我尝试多次更新记录时,只有第一次尝试成功.原因是version请求从服务器返回后未更新.(是的,服务器返回更新版本)
这对我来说是一个令人惊讶的行为,在我看来,这似乎是这里建议的预期功能 - https://github.com/ebryn/ember-model/issues/265.(但该帖子是从2013年开始的,建议的解决方案对我不起作用).
有任何想法吗?
对于completenes,这是相关代码(简化和重命名)
基于myModel
export default Ember.Model.extend({
typedId: attr('string') // this serves as an ID
version: attr('string'),
name: attr('string'),
markup: attr('number'),
});
Run Code Online (Sandbox Code Playgroud)
myAdapter
RESTAdapter.extend({
createRecord(store, type, snapshot) {
// call to serializer
const serializedData = this.serialize(snapshot, options);
const url = 'http://some_internal_api_url';
// this returns a promise
const result = this.ajax(url, 'POST', serializedData);
return result;
}, …Run Code Online (Sandbox Code Playgroud) 我最近从ember 1.x搬到了2.6.我不能像以前那样使用addObject/pushObject.
Ember : 2.6.2
jQuery : 2.2.4
import Ember from 'ember';
export default Ember.Controller.extend({
test: ['sibi', 'john'],
init: function() {
this.get('test').pushObject('sebastian');
}
});
Run Code Online (Sandbox Code Playgroud)
这会抛出像pushObject不是函数的错误.解决方法是什么?谢谢.
chart.js ×3
charts ×2
ember.js ×2
ember-cli ×1
ember-data ×1
emoji ×1
glyphicons ×1
linechart ×1
momentjs ×1
mozilla ×1
opera ×1
scatter ×1
scatter-plot ×1