Skip to content

Instantly share code, notes, and snippets.

@oeway
Created October 26, 2018 16:44
Show Gist options
  • Save oeway/c6a3cab32b2a42f23af9ccd355c023c6 to your computer and use it in GitHub Desktop.
Save oeway/c6a3cab32b2a42f23af9ccd355c023c6 to your computer and use it in GitHub Desktop.
<config lang="json">
{
"name": "C3.js Demo",
"mode": "window",
"tags": [],
"ui": "UI for Untitled Plugin",
"version": "0.1.0",
"api_version": "0.1.1",
"description": "describe your plugin here.",
"icon": "extension",
"inputs": null,
"outputs": null,
"dependencies": []
}
</config>
<script lang="javascript">
class ImJoyPlugin {
async setup() {
await importScripts("https://d3js.org/d3.v5.min.js", "https://cdnjs.cloudflare.com/ajax/libs/c3/0.6.8/c3.min.js")
}
run(my) {
var chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
}
}
api.export(new ImJoyPlugin())
</script>
<window lang="html">
<div>
<div id="chart"></div>
</div>
</window>
<!-- Load c3.css -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.6.8/c3.min.css" rel="stylesheet">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment