404
Looks like we've got some broken links.Take me home.
diff --git a/.gitignore b/.gitignore index bc93dbb2..c6e15ec8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ selenium-debug.log test/unit/coverage test/e2e/reports es/ +docs/.vuepress/dist diff --git a/deploy-docs.sh b/deploy-docs.sh index 6f989bfe..90fd6c05 100644 --- a/deploy-docs.sh +++ b/deploy-docs.sh @@ -10,4 +10,11 @@ cd docs/.vuepress/dist # if you are deploying to a custom domain echo 'vue-chartjs.org' > CNAME -touch .nojekyll + +git init +git add -A +git commit -m 'docs: Deploy docs' + +git push -f git@github.com:apertureless/vue-chartjs.git master:gh-pages + +cd - diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index e591c1ea..b55b2cc0 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -12,7 +12,7 @@ module.exports = { editLinkText: 'Help us improve this page!', docsDir: 'docs', docsBranch: 'master', - base: '/vue-chartjs/', + serviceWorker: true, locales: { '/': { selectText: 'Languages', diff --git a/docs/.vuepress/dist/.nojekyll b/docs/.vuepress/dist/.nojekyll deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/.vuepress/dist/404.html b/docs/.vuepress/dist/404.html deleted file mode 100644 index b3dc451e..00000000 --- a/docs/.vuepress/dist/404.html +++ /dev/null @@ -1,17 +0,0 @@ - - -
- - -There are some basic props defined in the components provided by vue-chartjs
. Because you extend
them, they are invisible, but you can overwrite them:
Prop | Description |
---|---|
width | chart width |
height | chart height |
chart-id | id of the canvas |
css-classes | String with css classes for the surrounding div |
styles | Object with css styles for the surrounding div container |
plugins | Array with chartjs plugins |
If the reactiveData
or reactiveProp
mixin is attached, following events will be emitted:
Event | Description |
---|---|
chart:render | if the mixin performs a complete rerender |
chart:destroy | if the mixin deletes the chart object instance |
chart:update | if the mixin performs an update instead of a re-render |
labels:update | if new labels were set |
xlabels:update | if new xLabels were set |
ylabels:update | if new yLabels were set |
Global Methods need to be imported.
Function
chart-id
, chart-type
import { generateChart } from 'vue-chartjs'
-// First argument is the chart-id, second the chart type.
-const CustomLine = generateChart('custom-line', 'LineWithLine')
-
Instance methods can be used inside your chart component.
Helper function to generate a HTML legend.
Function
none
import { Line } from 'vue-chartjs'
-
-export default {
- extends: Line,
- props: ['datasets', 'options']
- data: () => ({
- htmlLegend: null
- })
- mounted () {
- this.renderChart(this.datasets, this.options)
- this.htmlLegend = this.generateLegend()
- }
-}
-
-
In Chart.js you can define global and inline plugins. Global plugins are working without problems with vue-chartjs
like in the Chart.js docs described.
If you want to add inline plugins, vue-chartjs
exposes a helper method called addPlugin()
-You should call addPlugin()
before the renderChart()
method.
Function
Array
of Pluginsmounted () {
- this.addPlugin({
- id: 'my-plugin',
- beforeInit: function (chart) {
- ....
- }
- })
-}
-
Creates a Chart.js instance and renders the chart.
Function
Chart Data
, Chart Options
mounted () {
- this.renderChart({
- labels: ['January', 'February'],
- datasets: [
- {
- label: 'Data One',
- backgroundColor: '#f87979',
- data: [40, 20]
- }
- ]},
- {
- responsive: true
- }
- )
-}
-
You can access the Chart.js object inside your chart component with this.$data._chart
You can access the canvas with this.$refs.canvas