We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { Chart } from '@antv/g2';
const data = [ { time: '10:10', call: 4, waiting: 2, people: 2 }, { time: '10:15', call: 2, waiting: 6, people: 3 }, { time: '10:20', call: 13, waiting: 2, people: 5 }, { time: '10:25', call: 9, waiting: 9, people: 1 }, ];
const data1 = [ { time: '10:15', call: 2, waiting: 6, people: 3 }, { time: '10:10', call: 4, waiting: 2, people: 2 }, { time: '10:20', call: 13, waiting: 2, people: 5 }, { time: '10:25', call: 9, waiting: 9, people: 1 }, ]; const chart = new Chart({ container: 'container', autoFit: true, });
chart .data(data) .interval() .encode('x', 'time') .encode('y', 'waiting') .axis('y', { title: 'Waiting', titleFill: '#5B8FF9' }) .scale('x', { domain: ['10:10', '10:15', '10:20', '10:25'], });
chart .data(data1) .line() .encode('x', 'time') .encode('y', 'people') .encode('shape', 'smooth') .style('stroke', '#fdae6b') .style('lineWidth', 2) .scale('y', { independent: true }) .scale('x', { domain: ['10:10', '10:15', '10:20', '10:25'], }) .axis('y', { position: 'right', grid: null, title: 'People', titleFill: '#fdae6b', });
chart.render();
No response
The text was updated successfully, but these errors were encountered:
有大佬看看吗
Sorry, something went wrong.
想知道+1
No branches or pull requests
问题描述
import { Chart } from '@antv/g2';
const data = [
{ time: '10:10', call: 4, waiting: 2, people: 2 },
{ time: '10:15', call: 2, waiting: 6, people: 3 },
{ time: '10:20', call: 13, waiting: 2, people: 5 },
{ time: '10:25', call: 9, waiting: 9, people: 1 },
];
const data1 = [
{ time: '10:15', call: 2, waiting: 6, people: 3 },
{ time: '10:10', call: 4, waiting: 2, people: 2 },
{ time: '10:20', call: 13, waiting: 2, people: 5 },
{ time: '10:25', call: 9, waiting: 9, people: 1 },
];
const chart = new Chart({
container: 'container',
autoFit: true,
});
chart
.data(data)
.interval()
.encode('x', 'time')
.encode('y', 'waiting')
.axis('y', { title: 'Waiting', titleFill: '#5B8FF9' })
.scale('x', {
domain: ['10:10', '10:15', '10:20', '10:25'],
});
chart
.data(data1)
.line()
.encode('x', 'time')
.encode('y', 'people')
.encode('shape', 'smooth')
.style('stroke', '#fdae6b')
.style('lineWidth', 2)
.scale('y', { independent: true })
.scale('x', {
domain: ['10:10', '10:15', '10:20', '10:25'],
})
.axis('y', {
position: 'right',
grid: null,
title: 'People',
titleFill: '#fdae6b',
});
chart.render();
重现链接
No response
重现步骤
No response
预期行为
No response
平台
屏幕截图或视频(可选)
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: