Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The page is blank? #13

Closed
wanghaixu opened this issue Oct 18, 2016 · 7 comments
Closed

The page is blank? #13

wanghaixu opened this issue Oct 18, 2016 · 7 comments

Comments

@wanghaixu
Copy link

Expected Behavior

Actual Behavior

npm i => npm run dev => The page is blank

Environment

  • OS: Write here
  • NPM Version: Write here
    ^1.1.3
@apertureless
Copy link
Owner

Hello @wanghaixu

yes, the page is blank, because the entrypoint index.js contains only the exports of all modules.

If you want to see the example charts you would have to create a vue instance and import the app component under the examples folder.

import Vue from 'vue'
import App from './examples/App.vue'

/* eslint-disable no-new */
new Vue({
  components: { App }
}).$mount('#app')

@wanghaixu
Copy link
Author

ok

@apertureless
Copy link
Owner

I will maybe change the webpack conf for develeopment so it does not use the index.js as an entry point, but a dev.js or main.js with the imported app.

@wanghaixu
Copy link
Author

I want to apply to the mobile devices, but the effect is not very good。

@wanghaixu
Copy link
Author

image

@apertureless
Copy link
Owner

You should check the Chart.js documentation

There are two options for responsiveness:

  • responsive
  • maintainAspectRatio

If you set responsive to true, the chart will always fill the whole div in which the canvas is. If you set it to false, the canvas will set the width and height to the value which you set over the width and height props. And it resizes the chart, if the div resizes.

And with maintainAspectRatio you maintain the original canvas aspect ratio (width / height) when resizing

You can try to play around with this settings to get a better responsive view.
However you will have to apply styles etc. to the containing div.

@wanghaixu
Copy link
Author

Thank you for your guidance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants