xou / elixlsx

An Elixir XLSX writer
MIT License
293 stars 116 forks source link

Add text rotation style #118

Open antoinereyt opened 3 years ago

antoinereyt commented 3 years ago

Adding support for text rotation

Screen Shot 2021-10-15 at 13 01 03

Usage

# Text rotation.
sheet7 =
  %Sheet{name: "Text rotation"}
  |> Sheet.set_cell("A1", "Hello - angle_ccw",  text_rotation: :angle_ccw)
  |> Sheet.set_cell("B1", "Hello - angle_cw",  text_rotation: :angle_cw)
  |> Sheet.set_cell("C1", "Vertical - vertical", text_rotation: :vertical)
  |> Sheet.set_cell("D1", "Hello - rotate_up", text_rotation: :rotate_up)
  |> Sheet.set_cell("E1", "Hello - rotate_down", text_rotation: :rotate_down)
  |> Sheet.set_cell("F1", "Hello - 20", text_rotation: 20)

XML

This adds the textRotation xml attribute.

    <xf numFmtId="0" fontId="0" fillId="2" borderId="1" xfId="0" applyFill="1" applyBorder="1" applyAlignment="1">
      <alignment vertical="center" textRotation="180"/>
    </xf>
CharlesOkwuagwu commented 2 years ago

@xou Please can this PR be pulled into master?