first commit
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - multiple horizontal steps
|
||||
*
|
||||
* Demo of multiple step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-horizontal-multiple", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(55, 25, 10, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addCategoryAxis("x", "Month");
|
||||
x.addOrderRule("Date");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addMeasureAxis("y", "Unit Sales");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries("Channel", dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
|
||||
// Add legend
|
||||
// ------------------------------
|
||||
|
||||
var myLegend = myChart.addLegend(0, 5, "100%", 0, "right");
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
// Legend font style
|
||||
myLegend.fontSize = "12";
|
||||
myLegend.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
|
||||
// Remove axis titles
|
||||
x.titleShape.remove();
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
|
||||
// Remove axis titles
|
||||
x.titleShape.remove();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,114 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - grouped multiple horizontal steps
|
||||
*
|
||||
* Demo of multiple grouped step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-horizontal-multiple-grouped", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(55, 10, 100, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addCategoryAxis("x", ["Owner", "Month"]);
|
||||
x.addGroupOrderRule("Date");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addMeasureAxis("y", "Unit Sales");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries(["Brand"], dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
// Steps space
|
||||
s.barGap = 0.05;
|
||||
|
||||
|
||||
// Add legend
|
||||
// ------------------------------
|
||||
|
||||
var myLegend = myChart.addLegend("100%", 0, 0, "100%", "right");
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
// Legend font style
|
||||
myLegend.fontSize = "12";
|
||||
myLegend.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,101 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - horizontal step
|
||||
*
|
||||
* Demo of a single step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-horizontal-single", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(55, 10, 10, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addCategoryAxis("x", "Month");
|
||||
x.addOrderRule("Date");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addMeasureAxis("y", "Unit Sales");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries(null, dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
// Remove axis titles
|
||||
x.titleShape.remove();
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
|
||||
// Remove axis titles
|
||||
x.titleShape.remove();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - grouped horizontal steps
|
||||
*
|
||||
* Demo of grouped steps chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-horizontal-single-grouped", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(55, 10, 10, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addCategoryAxis("x", ["Owner", "Month"]);
|
||||
x.addGroupOrderRule("Date");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addMeasureAxis("y", "Unit Sales");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries("Owner", dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
// Line space
|
||||
s.barGap = 0.05;
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,108 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - multiple vertical steps
|
||||
*
|
||||
* Demo of multiple step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-vertical-multiple", "100%", 500);
|
||||
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(70, 25, 20, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addMeasureAxis("x", "Unit Sales");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addCategoryAxis("y", "Month");
|
||||
y.addOrderRule("Date");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries("Channel", dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
|
||||
// Add legend
|
||||
// ------------------------------
|
||||
|
||||
var myLegend = myChart.addLegend(0, 5, "100%", 0, "right");
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
// Legend font style
|
||||
myLegend.fontSize = "12";
|
||||
myLegend.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,114 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - multiple vertical steps
|
||||
*
|
||||
* Demo of grouped multiple step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-vertical-multiple-grouped", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(70, 10, 100, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addMeasureAxis("x", "Unit Sales");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addCategoryAxis("y", ["Owner", "Month"]);
|
||||
y.addGroupOrderRule("Date");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries(["Brand"], dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
// Line space
|
||||
s.barGap = 0.05;
|
||||
|
||||
|
||||
// Add legend
|
||||
// ------------------------------
|
||||
|
||||
var myLegend = myChart.addLegend("100%", 5, 0, "100%", "right");
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
// Legend font style
|
||||
myLegend.fontSize = "12";
|
||||
myLegend.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
|
||||
// Position legend text
|
||||
myLegend.shapes.selectAll("text").attr("dy", "1");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,94 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - single vertical step
|
||||
*
|
||||
* Demo of a single step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-vertical-single", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(70, 10, 20, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addMeasureAxis("x", "Unit Sales");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addCategoryAxis("y", "Month");
|
||||
y.addOrderRule("Date");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add line
|
||||
var s = myChart
|
||||
.addSeries(null, dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,97 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Dimple.js - vertical grouped step
|
||||
*
|
||||
* Demo of a grouped step chart. Data stored in .tsv file format
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
$(function () {
|
||||
|
||||
// Construct chart
|
||||
var svg = dimple.newSvg("#dimple-step-vertical-single-grouped", "100%", 500);
|
||||
|
||||
|
||||
// Chart setup
|
||||
// ------------------------------
|
||||
|
||||
d3.tsv("assets/demo_data/dimple/demo_data.tsv", function (data) {
|
||||
|
||||
// Filter data
|
||||
data = dimple.filterData(data, "Owner", ["Aperture", "Black Mesa"])
|
||||
|
||||
|
||||
// Create chart
|
||||
// ------------------------------
|
||||
|
||||
// Define chart
|
||||
var myChart = new dimple.chart(svg, data);
|
||||
|
||||
// Set bounds
|
||||
myChart.setBounds(0, 0, "100%", "100%")
|
||||
|
||||
// Set margins
|
||||
myChart.setMargins(70, 10, 20, 45);
|
||||
|
||||
|
||||
// Create axes
|
||||
// ------------------------------
|
||||
|
||||
// Horizontal
|
||||
var x = myChart.addMeasureAxis("x", "Unit Sales");
|
||||
|
||||
// Vertical
|
||||
var y = myChart.addCategoryAxis("y", ["Owner", "Month"]);
|
||||
y.addGroupOrderRule("Date");
|
||||
|
||||
|
||||
// Construct layout
|
||||
// ------------------------------
|
||||
|
||||
// Add lines
|
||||
var s = myChart
|
||||
.addSeries("Owner", dimple.plot.line)
|
||||
.interpolation = "step";
|
||||
|
||||
// Line space
|
||||
s.barGap = 0.05;
|
||||
|
||||
|
||||
// Add styles
|
||||
// ------------------------------
|
||||
|
||||
// Font size
|
||||
x.fontSize = "12";
|
||||
y.fontSize = "12";
|
||||
|
||||
// Font family
|
||||
x.fontFamily = "Roboto";
|
||||
y.fontFamily = "Roboto";
|
||||
|
||||
|
||||
//
|
||||
// Draw chart
|
||||
//
|
||||
|
||||
// Draw
|
||||
myChart.draw();
|
||||
|
||||
|
||||
// Resize chart
|
||||
// ------------------------------
|
||||
|
||||
// Add a method to draw the chart on resize of the window
|
||||
$(window).on('resize', resize);
|
||||
$('.sidebar-control').on('click', resize);
|
||||
|
||||
// Resize function
|
||||
function resize() {
|
||||
|
||||
// Redraw chart
|
||||
myChart.draw(0, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user