Wijmo UI for the Web
Rotate Bar Labels

Building on the Quick Start example, you can rotate the labels that appear on each bar in the chart using either of two methods. One uses the chartLabelStyle option, and the other accesses the chartLabels using the data fields chartElements collection.

To format the numeric values of these labels, use the chartLabelFormatString option. To hide them, use the showChartLabels option.

Note: The latest Raphaël JavaScript Library combines scale, rotate and translate within the transform attribute. This means that if you try to use the rotation attribute alongside the transform attribute, rotation is overwritten. If you want to reposition the label as well as rotate it, use the transform attribute for both. See the transform attribute of chartLabelStyle for more information.
  1. In the <head> section of your HTML file, replace the script that includes the document ready function with this one, which sets the chartLabelStyle option to rotate the labels by 90 degrees.

    Drop down and copy code

    Or replace it with this one, which accesses the chartLabels collection to rotate the labels.

    Drop down and copy code

  2. No changes are necessary in the <body> section of your HTML file. The basic <div> tag is sufficient to create the chart.
  3. Save your HTML file and open it in a browser. The chart appears like the one in the image below, with the labels rotated by 90 degrees.

See Also

Reference

Concepts

Widgets

 
Support Options