Wijmo UI for the Web
Format All Numeric Values

Building on the Quick Start example, you can change the formatting of the numeric values for the axis labels, chart labels, and tooltips.

  1. In the <head> section of your HTML file, replace the script that includes the document ready function with this one, which does the following:
    • Sets the following three labels to use p0 formatting (percentage with no decimals):
      • Y axis annotation labels
      • Labels for each bar in the chart (chartLabelFormatString)
      • Data labels within the hint option
    • Creates a series with the following properties:
      • Tooltips display with "2012 Auto Sales" and the data value when you mouse over each bar.
      • A legend displays.
      • The X axis displays major auto manufacturers.
      • The Y axis displays the percentage of increase in sales over the previous year.

    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 all of the numeric data values formatted to show percentages.

See Also

Widgets

Reference

 
Support Options