Displaying Results, Tables and Charts

We've seen how we can create our own Valuation Models and also print information to the bottom console.
It is important to note that the console is only for developing purposes, so anything we print in our valuation will not be displayed in the Company Valuation Tab.
In this page, we will be learning how to display data in the Company Valuation Tab for a better visualization(Hint: Value List, Tables and Charts).

Displaying results in the Value List

In order to display a value in the Value List, we need to call a function named monitor(context);
Let's give it a try:

  1. Head to the Valuation page.
  2. Copy and Paste the following Code:
  3. Fill in the required "Ticker..." field with a random ticker, for example "AAPL", and press Run.
    (It doesn't matter what we put in the ticker field for this example, since it is not retrieving any Company data)
  4. Press the "Show Monitor" button
  5. Example 1 prints the value both to the console and the monitor (the simplest solution).
    Example 2 prints a 2 decimal number (#).
    Example 3 prints a 2 decimal percentage (%).
    Example 4 displayed only in the monitor, however it is more complicated to use.

We can use this to display key values that we want to quickly observe (Such as a calculated intrinsic value of a stock, or if the company is considered overvalued/undervalued)
Note the syntax of the contextItem:

  • The name is the name of the value
  • The display needs to be set to 'value'
  • The data should be a single value
Displaying Tables

If we have multiple values, maybe it could be useful to display them as a table.
Perform the same steps as for displaying values, but replace the code with the following:

Note that the properties are different.

  • The display needs to be set to 'table'
  • The rows names are ['row1', 'row2']
  • The columns names are ['Abc', 'Def', 'Ghi', 'Jkl']
  • The table is going to be 2x4, so we need to make sure the data is made of 2 lists of 4 elements each
Displaying Charts

To display a series of values as a chart, we need to use the following code:

Note that the properties are different.

  • display needs to be set to 'chart'
  • x stores the values for the X-axis(This can represent the dates, for example)
  • y stores the values for Y-axis(for each Dataset)
  • labels are the names for each dataset
Putting it all together

Let's try to make a Valuation Model that displays the following information:

  1. The values for last year's Free Cash Flow and Net Income.
  2. A table that contains 10 years of Free Cash Flow and Net Income.
  3. A chart that contains 10 years of Free Cash Flow and Net Income.

This example is just for demonstration purposes, feel free to use this code in your valuations.

The JavaScript language can be a bit hard to grasp especially for someone who is new to programming, therefore, a good starting point for learning could be w3schools.com/js/.
If you have any issues, please don't hesitate to ask questions in the #questions section.
Also, feel free to use the Community to post comments with your own analysis/algorithms, and the Tutorials section to learn more about finance and coding.
If you need help, please send us a message using the help page.

Hooray! You're all set!

Go to Main Page