-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Johnston
committed
Oct 17, 2021
1 parent
80a2bda
commit d23a212
Showing
9 changed files
with
3,180 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<div> | ||
|
||
|
||
<h3>{{title}}</h3> | ||
<p>{{subtitle}}</p> | ||
|
||
<Plotly :data="data" :layout="layout" :display-mode-bar="false"></Plotly> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { Plotly } from "vue-plotly"; | ||
export default { | ||
name: "MyChart", | ||
components: { Plotly }, | ||
data() { | ||
const rawData = this.$root.$data.chartData; | ||
rawData.sort((a,b) => { | ||
return a.year - b.year; | ||
}); | ||
const x = rawData.map((v) => v.year); | ||
const y = rawData.map((v) =>v.count); | ||
return { | ||
title: "Number of babies given the name 'David' in Victoria" , | ||
subtitle: "(When the name David was in the 100 most popular names)", | ||
data: [ | ||
{ | ||
x,y, | ||
type: "bar", | ||
}, | ||
], | ||
layout: { | ||
title: "", // Leave the title blank because we'll provide our own | ||
xaxis: { | ||
title: "Year" | ||
}, | ||
yaxis: { | ||
title: "Count" | ||
}, | ||
}, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<!-- Add "scoped" attribute to limit CSS to this component only --> | ||
<style scoped> | ||
</style> |
This file contains 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
Oops, something went wrong.