spaceLayer
Previous
spaceFlex
Next
timingKeyframe
Loading...
Does not divide space in any way, multiple views use the same spatial area, commonly used for view layering.
Draw a common combined bar and pie chart.
import { Chart } from '@antv/g2';const chart = new Chart({container: 'container',});const layer = chart.spaceLayer().data({type: 'fetch',value:'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',format: 'csv',});// Bar chartlayer.interval().attr('paddingLeft', 50).transform({ type: 'sortX', reverse: true, by: 'y' }).encode('x', 'letter').encode('y', 'frequency').encode('color', 'letter');// Pie chartlayer.interval().attr('paddingLeft', 400).attr('paddingBottom', 200).coordinate({ type: 'theta' }).transform({ type: 'stackY' }).legend(false).encode('y', 'frequency').encode('color', 'letter');chart.render();
For more examples, visit the Chart Examples page.
No additional configuration options.