tnzk / Raphael-Radar

Raphael Radar is a JavaScript library to draw a controlable radar chart using Raphael.js, a JavaScript library to draw SVG
http://www.tnzk.org/devel/Raphael-Radar/example/
27 stars 14 forks source link

Hello,how to set Raphael-Radar size? #2

Open Coca-code opened 8 years ago

Coca-code commented 8 years ago

Hello,I have run it successful, but I can not set it's size. It's width is 250px; height is 250px. I want to use 'rem' units. How can I do in a 'Html \css\ js ' project? Thank you.

========================================

显示以下内容的翻译: Hello,I have run it successful, but I can not set it's size. Its width is 250px; height in 250px. I want to use 'rem' units. How can I do in a 'Html \css\ js ' project? Thank you. 仍然翻译: Hello,I have run it successful, but I can not set it's size. It's width is 250px; height is 250px. I want to use 'rem' units. How can I do in a 'Html \css\ js ' project? Thank you. こんにちは、私はそれが成功し実行してきたが、私はそれがサイズだ設定することはできません。その幅が250ピクセルです。 250ピクセルで高さ。私は「レム」単位を使用したいと思います。どのように私は'Htmlの\ CSS\ jsファイル'プロジェクトで行うことができますか? ありがとうございました。

jeraldkingn commented 4 years ago

just change the values of 150,150 that is your width and height

tnzk commented 4 years ago

@Coca-code I have not noticed this but what @jeraldkingn suggests seems to be correct.

tnzk commented 4 years ago

@Coca-code Raphael itself does not seem to accept numbers in rem for the size of canvas. Would this work for you:

  1. Create an element styled with width: Xrem; height: Yrem.
  2. Get size of the element in pixel with JS.
  3. Initialize Raphael-Rafar with the size you got above.