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

Control the SVG size and width/height ratio #41

Open
chenjiandongx opened this issue Oct 7, 2019 · 12 comments

Comments

@chenjiandongx
Copy link

commented Oct 7, 2019

Hi @timqian, Is there a easy way to control the SVG size?

I try to set width and height attr like this

<svg class="line-chart" width="800px" height="600px"></svg>

but it seem doesn't work. :)

@timqian

This comment has been minimized.

Copy link
Owner

commented Oct 7, 2019

The width of the svg depends on its parent. You can change the width of its parent to change its size.

@timqian

This comment has been minimized.

Copy link
Owner

commented Oct 7, 2019

The ratio of with and height is hard coded to 4/3. Adding a setting to config it might be good. I am considering adding this

@chenjiandongx

This comment has been minimized.

Copy link
Author

commented Oct 7, 2019

Now div is the parent tag,

  <div width="800px" height="600px" width="800px">
      <svg class="line-chart"></svg>
  </div>

but.. SVG shows incomplete

image

@chenjiandongx

This comment has been minimized.

Copy link
Author

commented Oct 7, 2019

It would be nice if added a new setting opts for it.

@timqian

This comment has been minimized.

Copy link
Owner

commented Oct 7, 2019

Try

  <div style="width:800px;">
      <svg class="line-chart"></svg>
  </div>
@chenjiandongx

This comment has been minimized.

Copy link
Author

commented Oct 7, 2019

It works, :)

The ratio of with and height is hard coded to 4/3.

and is this will be changed in the future?

@timqian

This comment has been minimized.

Copy link
Owner

commented Oct 7, 2019

The default will always be 4/3, I think adding an option to change it might be good

@timqian timqian changed the title Can I control the SVG size? Control the SVG size and width/height ration Oct 7, 2019
@timqian

This comment has been minimized.

Copy link
Owner

commented Oct 7, 2019

I will keep this issue open for size & ratio related updates

@timqian timqian changed the title Control the SVG size and width/height ration Control the SVG size and width/height ratio Oct 7, 2019
@chenjiandongx

This comment was marked as off-topic.

Copy link
Author

commented Oct 8, 2019

@timqian I'm the author of pyecharts. Echarts is a great visualization library created by Baidu frontend team.

I got an idea that combines chart.xkcd with python. Because your charts lib is so adorable and I like such hand drawing style things.

But now it just an idea and not on the shedule temporarily :)

@timqian timqian self-assigned this Oct 9, 2019
@timqian timqian added the new option label Oct 9, 2019
@chenjiandongx

This comment was marked as off-topic.

Copy link
Author

commented Oct 12, 2019

@timqian

This comment was marked as off-topic.

Copy link
Owner

commented Oct 12, 2019

@chenjiandongx Nice job! I listed your tool in "who is using chart.xkcd" issue here #14

@chenjiandongx

This comment was marked as off-topic.

Copy link
Author

commented Oct 12, 2019

@timqian Yes, 👍 already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.