Wijmo UI for the Web
Get the Number of Bars

Building on the Quick Start example, you can get the number of bars in your chart. Here, we only write the number out to the console log, but you can use it for any purpose you like.

  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:
    • Gets the number of bars in the chart.
    • Writes the number of bars to the console log.

    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, open it in a browser, and press the F12 key. If the console tab is not already showing, select Console. The number 6 appears, which is how many bars are in this chart.

See Also

Reference

Widgets

 
Support Options