You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/11/17 15:24:35 UTC
[GitHub] [incubator-echarts] Socrates005 commented on issue #2941: Handling click events on chart grid columns
Socrates005 commented on issue #2941:
URL: https://github.com/apache/incubator-echarts/issues/2941#issuecomment-729001204
I got a similar problem with calendar. Although it seems to work, but gives some strange 'dates' back. Anyone an idea?
part option<<
calendar: {
range: ['2020-10-01','2020-10-30'],
cellSize: 'auto'
},
series: {
name:'ls01',
type: 'scatter',
coordinateSystem: 'calendar',
symbolSize: function(val) {
return val[1] / 50;
},
data: [['2020-10-19', 500],['2020-10-15',200]]
}
>>
var zr = chartObstructie.getZr();
zr.on('click',function(params) {
var pointInPixel = [params.offsetX, params.offsetY];
var pointInGrid = chartObstructie.convertFromPixel('calendar', pointInPixel);
console.log(new Date(pointInGrid));
});
When you click the first date -> 10/10 and suddenly it jumps several months/years - depending on the selected range.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org