Created
November 30, 2018 15:34
-
-
Save lukasasorensen/b12c0f3e6713f094581b7ba03a5a81ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] | |
}) | |
export class AppComponent { | |
vm = this; | |
title = 'tinymce-charts-angular'; | |
receiveMessage = function(e){ | |
if(e.origin !== "http://localhost:5050"){ return; }; | |
if(e.data === 'giveMeChartData'){ | |
e.source.postMessage({chartData: { | |
data: { | |
series: [1,2,6,7], | |
labels: [ | |
"Apples", | |
"Bananas", | |
"Cherries", | |
"!!JOHNCENA!!!" | |
] | |
}, | |
aspectRatio: [9, 16], | |
ratioClass: "ct-major-tenth", | |
options: { | |
// height: 400, | |
// width: 400 | |
}, | |
type: "Pie" | |
}}, '*') | |
}; | |
}; | |
constructor(){ | |
window.addEventListener('message', this.receiveMessage, false); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment