私たちは、スクリーン上の5,000ポイントに達すると散布図が異常に作動するようになっています。具体的には、5k +ポイントで、ポイントをクリックするとポイントイベント「クリック」が停止し、ポイントフォーマット(fillColor &シンボル)が失われます。ハイチャート:マーカーの書式設定を保持し、クリックイベントを5K +点散布図で発生させるにはどうすればよいですか?
4999ポイント:http://jsfiddle.net/xrpf0pfq/7/
$(function() {
// Prepare the data
var data = [],
n = 4999, // < 5K points
i;
for (i = 0; i < n; i += 1) {
data.push([
Math.pow(Math.random(), 2) * 100,
Math.pow(Math.random(), 2) * 100
]);
}
if (!Highcharts.Series.prototype.renderCanvas) {
console.error('Module not loaded');
return;
}
console.time('scatter');
console.time('asyncRender');
$('#container').highcharts({
chart: {
zoomType: 'xy'
},
xAxis: {
min: 0,
max: 100,
gridLineWidth: 1
},
yAxis: {
// Renders faster when we don't have to compute min and max
min: 0,
max: 100,
minPadding: 0,
maxPadding: 0
},
title: {
text: 'Scatter chart with ' + Highcharts.numberFormat(data.length, 0, ' ') + ' points'
},
legend: {
enabled: false
},
series: [{
type: 'scatter',
data: data,
marker: {
radius: 5,
symbol: 'triangle', //shows correctly
fillColor: 'rgba(128,0,128,1)' //shows correctly
},
point: {
events: {
click: function() {
alert("click"); //event is fired correctly
}
}
},
tooltip: {
enable: false,
followPointer: false,
pointFormat: '[{point.x:.1f}, {point.y:.1f}]'
},
events: {
renderedCanvas: function() {
console.timeEnd('asyncRender');
}
}
}]
});
console.timeEnd('scatter');
});
5000ポイント:http://jsfiddle.net/xrpf0pfq/10/
$(function() {
// Prepare the data
var data = [],
n = 5000, // 5K points
i;
for (i = 0; i < n; i += 1) {
data.push([
Math.pow(Math.random(), 2) * 100,
Math.pow(Math.random(), 2) * 100
]);
}
if (!Highcharts.Series.prototype.renderCanvas) {
console.error('Module not loaded');
return;
}
console.time('scatter');
console.time('asyncRender');
$('#container').highcharts({
chart: {
zoomType: 'xy'
},
xAxis: {
min: 0,
max: 100,
gridLineWidth: 1
},
yAxis: {
// Renders faster when we don't have to compute min and max
min: 0,
max: 100,
minPadding: 0,
maxPadding: 0
},
title: {
text: 'Scatter chart with ' + Highcharts.numberFormat(data.length, 0, ' ') + ' points'
},
legend: {
enabled: false
},
series: [{
type: 'scatter',
data: data,
marker: {
radius: 5,
symbol: 'triangle', //marker shape not showing
fillColor: 'rgba(128,0,128,1)' //color not showing
},
point: {
events: {
click: function() {
alert("click"); //click even not firing
}
}
},
tooltip: {
enable: false,
followPointer: false,
pointFormat: '[{point.x:.1f}, {point.y:.1f}]'
},
events: {
renderedCanvas: function() {
console.timeEnd('asyncRender');
}
}
}]
});
console.timeEnd('scatter');
});
マーカーの書式設定を維持し、あなたが飛散上5K以上のポイントを持っていたときにクリックイベントの火を作成する方法はありますプロット?
のために働く必要がありますあなたはFusionChartsのを使用してzoomscatterチャートを試すことができます。クリック機能をそのままにして、5k +データを簡単にレンダリングできます。これを確認してくださいhttp://jsfiddle.net/4dakvt9a/1/ – Ayan
デフォルトでは正常に動作するはずです。ここでは5,000ポイントと同じクリックイベントの例を参照してください:http://jsfiddle.net/jlbriggs/dtvwrwwy/ – jlbriggs
皮肉なことに、ブーストモジュールが問題を引き起こしているようです。ここにあなたの例はありません:http://jsfiddle.net/jlbriggs/xrpf0pfq/11/ – jlbriggs