Commit d04c138e authored by nikogu's avatar nikogu
parent cfa80630
...@@ -64,6 +64,12 @@ class TimelineChart extends Component { ...@@ -64,6 +64,12 @@ class TimelineChart extends Component {
position: 'top', position: 'top',
}); });
let max;
if (data[0] && data[0].y1 && data[0].y2) {
max = Math.max(data.sort((a, b) => b.y1 - a.y1)[0].y1,
data.sort((a, b) => b.y2 - a.y2)[0].y2);
}
chart.source(data, { chart.source(data, {
x: { x: {
type: 'timeCat', type: 'timeCat',
...@@ -73,10 +79,12 @@ class TimelineChart extends Component { ...@@ -73,10 +79,12 @@ class TimelineChart extends Component {
}, },
y1: { y1: {
alias: titleMap.y1, alias: titleMap.y1,
max,
min: 0, min: 0,
}, },
y2: { y2: {
alias: titleMap.y2, alias: titleMap.y2,
max,
min: 0, min: 0,
}, },
}); });
......
...@@ -12,7 +12,7 @@ const chartData = []; ...@@ -12,7 +12,7 @@ const chartData = [];
for (let i = 0; i < 20; i += 1) { for (let i = 0; i < 20; i += 1) {
chartData.push({ chartData.push({
x: (new Date().getTime()) + (1000 * 60 * 30 * i), x: (new Date().getTime()) + (1000 * 60 * 30 * i),
y1: Math.floor(Math.random() * 100) + 10, y1: Math.floor(Math.random() * 100) + 1000,
y2: Math.floor(Math.random() * 100) + 10, y2: Math.floor(Math.random() * 100) + 10,
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment