Skip to content

Instantly share code, notes, and snippets.

@dranney-sugarcrm
Last active February 6, 2017 19:37
Show Gist options
  • Save dranney-sugarcrm/4a1561cb4f77f77f7ed0f0d9f76cb4e2 to your computer and use it in GitHub Desktop.
Save dranney-sugarcrm/4a1561cb4f77f77f7ed0f0d9f76cb4e2 to your computer and use it in GitHub Desktop.
Populate data for multiple charts
({
...
loadData: function() {
this.bluered = {
data: [
{
key: "Blue Stuff",
values: [
{
x: 1, y: 10
},
{
x: 2, y: 9
},
{
x: 3, y: 8
},
{
x: 4, y: 7
},
{
x: 5, y: 6
},
],
color: "#0000ff"
},
{
key: "Red Stuff",
values: [
{
x: 1, y: 1
},
{
x: 2, y: 2
},
{
x: 3, y: 3
},
{
x: 4, y: 4
},
{
x: 5, y: 5
},
],
color: "#ff0000"
},
],
properties: {
title: 'First Chart Data'
}
};
this.purpleteal = {
data: [
{
key: "Purple Stuff",
values: [
{
x: 1, y: 10
},
{
x: 2, y: 9
},
{
x: 3, y: 8
},
{
x: 4, y: 7
},
{
x: 5, y: 6
},
],
color: "#ff00ff"
},
{
key: "Teal Stuff",
values: [
{
x: 1, y: 1
},
{
x: 2, y: 2
},
{
x: 3, y: 3
},
{
x: 4, y: 4
},
{
x: 5, y: 5
},
],
color: "#00ffff"
},
],
properties: {
title: 'Second Chart Data'
}
};
this.yellowgray = {
data: [
{
key: "Yellow Stuff",
values: [
{
x: 1, y: 10
},
{
x: 2, y: 9
},
{
x: 3, y: 8
},
{
x: 4, y: 7
},
{
x: 5, y: 6
},
],
color: "#ffff00"
},
{
key: "Gray Stuff",
values: [
{
x: 1, y: 1
},
{
x: 2, y: 2
},
{
x: 3, y: 3
},
{
x: 4, y: 4
},
{
x: 5, y: 5
},
],
color: "#888888"
},
],
properties: {
title: 'Third Chart Data'
}
}
this.total = 1;
},
...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment