Skip to content

Instantly share code, notes, and snippets.

@lukasasorensen
Created November 30, 2018 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukasasorensen/b12c0f3e6713f094581b7ba03a5a81ac to your computer and use it in GitHub Desktop.
Save lukasasorensen/b12c0f3e6713f094581b7ba03a5a81ac to your computer and use it in GitHub Desktop.
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