2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SVGチャートをエレガントにするポイント

Last updated at Posted at 2016-03-04

SVGチャートが・・・

SVGチャート作ったけど、なんとなく洗練されていないなって思ったあなた。

これをどうぞ

main.css
body{
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

これでSVGに限らずWEB全体がエレガントになります。
CSSのfont-smoothingでフォントをキレイに見せる

これもどうぞ

main.css
.axis path,
.axis line {
    shape-rendering: crispEdges;
}

軸線のボヤけがなくなり、シャープになります。
shape-rendering


ポイントは直線にのみ適用する事です。
円などの曲線に対して適用すると、アンチエイリアス処理がかからなくなり見た目が劣化してしまいます。

お好きであればこれもどうぞ

main.css
.axis path,
.axis line {
    stroke-opacity: .5;
    stroke-dasharray: 3, 3;
    stroke-width: 0.5px;
}

軸線の印象を下げる事でデータに意識がフォーカスされるようになり、わかりやすくなります。

参考になるチャート

年収でこんなに違う 所得・消費税、あなたの負担は
原発事故 避難者の声
ビッグデータで知る防災

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?