Published
Edited
Jan 2, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataMainBranch = [
{ item: 'I am a developer by profession', count: 40, value: 0.7431 },
{ item: 'I am a student who is learning to code', count: 50, value: 0.1155 },
{ item: 'I am not primarily a developer, but I write code sometimes as part of my work', count: 10, value: 0.0855 },
{ item: 'I code primarily as a hobby', count: 15, value: 0.0379 },
{ item: 'I used to be a developer by profession, but no longer am', count: 8, value: 0.0180 },
];
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataHobbyist = [
{ item: 'Yes', value: 40 },
{ item: 'No', value: 60 },
];
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataOpenSourcer = [
{ item: 'Never', value: 37.6 },
{ item: 'Less than once per year', value: 22.4 },
{ item: 'Once a month or more often', value: 16 },
{ item: 'Less than once a month but more than once per year', value: 24 }
];
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataEmployment = [
{ item: 'Employed full-time', value: 37.6 },
{ item: 'Employed part-time', value: 17 },
{ item: 'Not employed, but looking for work', value: 15.4 },
{ item: 'Not employed, and not looking for work', value: 10 },
{ item: 'NA', value: 14 },
{ item: 'Independent contractor, freelancer, or self-employed', value: 6}
];
Insert cell
dataEmploymentchart = new G2.Chart({
container: 'c4',
forceFit: true,
height: 300,
padding: 'auto'
});
Insert cell
Insert cell
showDeveloperSurvey = (data, chart) => {
chart.source(data);
chart.legend({
position: 'right-center',
offsetX: -100
});
chart.coord('theta', {
radius: 0.75
});
chart.intervalStack().position('value').color('item', [ '#1890ff', '#37c661', '#fbce1e', '#2b3b79', '#8a4be2', '#1dc5c5' ])
.style({
stroke: 'white',
lineWidth: 1
})
.label('value', {
formatter: (val) => {
return val + '%';
}
});
chart.render();
return 'show'
}
Insert cell
client.describe()
Insert cell
Insert cell
client = DatabaseClient('developer_survey')
Insert cell
G2 = require('@antv/g2')
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more