-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
document is not defined #296
Comments
@Pimaweichai could you provide a repo that can reproduce the problem? |
@leungwensen Problem have solved. |
How? Could you share your solution here? |
@leungwensen https://github.com/JedWatson/exenv can provide the document. Now there's another problem is that when g2 and bizcharts will support React 16? |
the beta version will be ok, on this Friday. Really appreciate your help. @leungwensen |
Thank you! |
@Pimaweichai I am getting the same error. I have installed https://github.com/JedWatson/exenv and do not know where to use var ExecutionEnvironment = require('exenv'); |
@Pimaweichai I am also want to ask how do you solve this issue? Could you please paste an example code? Thanks! |
I found a way to solve this error without install import React from 'react';
import ReactDOM from 'react-dom';
let bizcharts;
if (process.browser) {
bizcharts = require('bizcharts');
}
const data = [
{ genre: 'Sports', sold: 275, income: 2300 },
{ genre: 'Strategy', sold: 115, income: 667 },
{ genre: 'Action', sold: 120, income: 982 },
{ genre: 'Shooter', sold: 350, income: 5271 },
{ genre: 'Other', sold: 150, income: 3710 }
];
const cols = {
sold: { alias: 'amount' },
genre: { alias: 'game type' }
};
export default () => {
return (
<div>
{process.browser &&
<bizcharts.Chart width={600} height={400} data={data} scale={cols}>
<bizcharts.Axis name="genre" />
<bizcharts.Axis name="sold" />
<bizcharts.Legend position="top" dy={-20} />
<bizcharts.Tooltip />
<bizcharts.Geom type="interval" position="genre*sold" color="genre" />
</bizcharts.Chart>
}
</div>
);
} |
@Pimaweichai |
Now I get this one...
|
G2 Version:
"bizcharts": "^3.0.5",
Platform:
mac
Mini Showcase(like screenshots):
When I use the bizcharts and render by server side. It shows the problem 'document is not defined'
I have create the issue at bizcharts alibaba/BizCharts#51. They suggest me to create a new issue here.
The text was updated successfully, but these errors were encountered: