Skip to content

Commit

Permalink
Fix #8045 (The last day of a month was not displayed).
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Mar 29, 2018
1 parent f928119 commit b18b505
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/coord/calendar/Calendar.js
Expand Up @@ -181,7 +181,10 @@ Calendar.prototype = {
var date = dayInfo.formatedDate;

// if not in range return [NaN, NaN]
if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time <= range.end.time)) {
if (clamp && !(
dayInfo.time >= range.start.time
&& dayInfo.time < range.end.time + PROXIMATE_ONE_DAY
)) {
return [NaN, NaN];
}

Expand Down
16 changes: 7 additions & 9 deletions test/calendar-graph.html
Expand Up @@ -20,6 +20,7 @@

var graphData = [
[
// This is the first day of Feb
1485878400000,
260
],
Expand All @@ -46,6 +47,11 @@
[
1488124800000,
985
],
[
// This is the last day of Feb. See #8045
1488240000000,
371
]
];

Expand All @@ -59,15 +65,6 @@

require([
'echarts'
// 'echarts/chart/heatmap',
// 'echarts/chart/scatter',
// 'echarts/chart/effectScatter',
// 'echarts/chart/graph',
// 'echarts/component/title',
// 'echarts/component/legend',
// 'echarts/component/calendar',
// 'echarts/component/tooltip',
// 'echarts/component/visualMap'
], function (echarts) {

var chart = echarts.init(document.getElementById('main'));
Expand All @@ -89,6 +86,7 @@

series: {
type: 'graph',
// type: 'scatter',
edgeSymbol: ['none', 'arrow'],
coordinateSystem: 'calendar',
links: links,
Expand Down

0 comments on commit b18b505

Please sign in to comment.