d3.json('data/fake_users1.json', function(data) {
data = MG.convert.date(data, 'date');
MG.data_graphic({
title: "Line Chart",
description: "This is a simple line chart. You can remove the area portion by adding area: false to the arguments list.",
data: data,
width: 600,
height: 200,
right: 40,
target: document.getElementById('fake_users1'),
x_accessor: 'date',
y_accessor: 'value'
});
});
d3.json('data/confidence_band.json', function(data) {
data = MG.convert.date(data, 'date');
MG.data_graphic({
title: "Confidence Band",
description: "This is an example of a graphic with a confidence band and extended x-axis ticks enabled.",
data: data,
format: 'percentage',
width: 600,
height: 200,
right: 40,
target: '#confidence_band',
show_secondary_x_label: false,
show_confidence_band: ['l', 'u'],
x_extended_ticks: true
});
});
d3.json('data/small-range.json', function(data) {
data = MG.convert.date(data, 'date');
MG.data_graphic({
title: "Small Range of Integers",
description: "When we have a data object of integers and a small range of values, the auto-generated set of y-axis ticks are filtered so that we don't include fractional values.",
data: data,
interpolate: 'basic',
width: 600,
height: 200,
right: 40,
target: '#small-range'
});
});
d3.json('data/brief-1.json', function(data) {
data = MG.convert.date(data, 'date');
MG.data_graphic({
title: "Linked Graphic",
description: "The two graphics in this section are linked together. A rollover in one causes a rollover in the other.",
data: data,
linked: true,
width: 600,
height: 200,
right: 40,
xax_count: 4,
target: '#briefing-1'
});
});
d3.json('data/brief-2.json', function(data) {
data = MG.convert.date(data, 'date');
MG.data_graphic({
title: "Other Linked Graphic",
description: "Roll over and watch as the graphic to the left triggers.",
data: data,
area: false,
linked: true,
width: 600,
height: 200,
right: 40,
xax_count: 4,
target: '#briefing-2'
});
});
MG.data_graphic({
title: "Singleton",
description: "Handling a solitary data point.",
data: [{'date': new Date('2015-03-05T21:00:00Z'), 'value': 12000}],
width: 600,
height: 200,
right: 40,
target: '#singleton'
});