Metropolis Documentation 4.3 > Applications > Chart

The Chart application lets you plot time series data on a chart. Chart has many features including:

  • Zooming and scrolling
  • Tools to enhance the illustration (highlighting, annotations, trend lines)
  • Data normalization for comparison
  • Splitting a chart into many subplots

When you're done, you can save the chart for later and share it with your team.

Getting Started

  1. Open the Chart application.
  2. Enter MSFT in the expression bar. Chart displays the Microsoft's closing price.
  3. Scroll backward and forward in time by dragging the chart left and right. Zoom in and out by scrolling the mouse wheel. You can also adjust the date ranges in the ribbon. For more information, see the Home Tab.
  4. Enter AAPL in the expression bar.
  5. Right-click on the plot and select Normalize -> Value Axis. This lets you compare the performance of multiple instruments from one starting point. The vertical grey line in the chart represents the date to which the series are normalized. Drag it left or right to change the normalization date.
  6. Enter AAPL.percentChange(1, Enum.MONTHS) in the expression bar. Since the percent change time series clutters the other time series on the chart, let's move it to a new subplot. Right-click its data bubble (the colored AAPL.percentChange bubble) and select Move to new subplot.
  7. Click on the Microsoft Corp data bubble. Notice that the blue Dataset tab now appears in the ribbon. The blue Dataset tab is an example of a contextual tab, meaning it appears only when relevant (e.g. when you've clicked on a data bubble). The Dataset tab contains many settings for modifying that piece of data. Switch the series from Line rendering to Points rendering.
  8. Click the Document sidebar or use the shortcut CTRL + S and then save this chart as MSFT vs. AAPL.

Basic Reference

You construct and view charts in the Home perspective, and bind variables in the Variables perspective.

The ribbon and the right-click menus contain most of the functionality in Chart. Some of the tabs, such as Plot, Axis, and Dataset, are contextual tabs, which means they are only visible when you select certain elements in the chart. Others, such as Home and Export, are always visible. This section describes each ribbon.

Home Ribbon


This tab contains the following options:

  • Date Range - Determines the range of the domain (x-axis) of the plot. You can fill in your own values or select one of the presets (1d, 1w, 1m, 3m, 6m, YTD, 1y, 5y, 10y, Max).
    • Pruning - Removes empty dates, such as weekends or non-trading hours, from time series and instruments.
    • Frequency - Specifies the frequency to sample the data from a time series. See the Frequency section on this page, or, for more information on time series in general, see Working with Time Series Data.
    • Timezone - Sets the timezone.
  • Annotations - Enables you to illustrate the chart with text, trendlines, and more.
  • Formatting - Change the background color of the entire chart.
  • Title - Add a title to the chart.
  • Compute - Use previous results, or recompute.

Export Ribbon


You can export chart data to the clipboard, to Microsoft Excel, to the Spreadsheet application, or to some other custom export. You can also take a screenshot of the chart, to paste into an email or report. Additionally, you can print to PDF or the printer.

Dataset Contextual Ribbon



This contextual tab is visible when a data bubble (colored legend bubble) is highlighted.

  • Dataset - lets you rename the data bubble and edit the underlying expression.
  • Renderer - determines how to display the data, such as a bar graph or line graph. You can also modify properties such as color, shape, width, and more.
  • Annotations - lets you illustrate the chart with text, trendlines and more. Annotations you make here correspond to the select data bubble. When you remove the data, these annotations also disappear.
  • Metadata - Displays metadata about a time series, e.g. the source of the data and the aggregation type it uses.
  • Relative Date Axis: Day 0 - lets you set a specific date as "Day 0" (the default is the first point in the time series). This option is only available if you check Relative Date Axis in the Plot contextual tab.

Plot Contextual Ribbon


The plot refers to the (x,y) grid in the Chart application. The Chart application starts with one empty plot and you can add more from there. When you click on a plot, the Plot contextual tab is visible in the ribbon.

  • Formatting - modify visual properties such as background color and gridlines. Also, lets you display zero lines.
  • Legend - Show / hide the data bubbles. Also, lets you add a title for the plot's legend.
  • Normalization - compare multiple instruments or time series by lining them up on a starting date.
    • Relative Date Axis - switches from using actual dates to using a linear count starting from a fixed date.
    • Range Normalized - a vertical grey line appears that represents the date to which the series are normalized. To change the normalization date, either drag the grey line in the plot or specify the date in the ribbon. Note that you can change the normalization date using this ribbon option even when the bar is not included in the displayed date range.

If you right-click a data bubble on the plot, you can perform the following task:

  • Move to new Subplot - moves the selected data to a new plot in the chart. Multiple plots help keep things visually organized. You can add, delete, and resize subplots. You can also drag data between plots.

Axis Contextual Ribbon

When you click on an axis, the Axis contextual tab is visible in the ribbon. The options are different depending on whether the X or Y axis is selected.

X Axis (horizontal)

Y Axis (vertical)

The Axis tab lets you do the following:

  • Range - Define the range of the axis. Date Range options are the same as those in the Home Tab.
    • Auto Range - Let the system choose a suitable domain (y-axis) range. The system automatically adjusts the range as you scroll through the data.
    • Logarithmic Scale - Use a logarithmic scale (1, 10, 100, 1000) instead of a linear scale (1, 2, 3, 4).
    • Inverted - Invert the range.
  • Value Formatting - Change the type of tick labels that are displayed.
  • Label - Change the axis' label as well as its font and color.
  • Formatting - Change the font and color of the axis tick labels.

If you right-click an axis, you can perform the following tasks:

  • Move to Other side - Moves the axis and value labels to the other side of the plot
  • Split and Merge - Splits and merges multiple axes on same plot.

Annotation Contextual Ribbon


When you click on a text annotation box, the Annotation tab is visible in the ribbon.

  • Format - modify the text annotation's appearance.
    • Floating - specify whether the text box is floating or fixed. When the box is not checked, the annotation is fixed to an x & y value - meaning that if you re-draw the series, or zoom in/out, the box will stayed fixed to a certain x,y pair and will appear to move when you move the chart. If the box is checked, the annotation is not fixed to any values and therefore appears to remain in the same spot on the plot when you zoom, scroll, or re-draw a series.
  • Compose - write and edit the text in the annotation.
    • To reference a variable in the text box, use the @variableName notation, where variableName is the name of a variable you previously created by using the Variables Perspective. For more information on variables, see Variables Perspective.

Variables Perspective

The Variables perspective allows you to create Chart Templates by binding objects to variables and then changing their values to represent other objects.

For more information about Templates, see The Variables Perspective.

Concepts and Features

Expression bar

The expression bar lets you add data, such as closing prices, historical volatility, and P/E Ratio, to the chart. Chart can plot four kinds of data: Time Series, Instruments, Date Sets, and Numbers. Let's explore each type.

  • Time Series - Plots each point in a time series (time, value) as as a point (x,y) in the chart. Here are some examples:
    • MSFT.ma(20)
    • MSFT.change().correl(GOOG.change())
    • AAPL.pe() - MSFT.pe()
    • (VLO.hvol + XOM.hvol + CVX.hvol) / 3
  • Instruments - Plots the instrument's closing price time series. However, you can also get OHLC data if you switch the rendering of an instrument to Candlestick or OHLC.
  • Datesets - Highlights the specified date or time range.
  • Number - Plots the number as a horizontal line.

Frequency

The Frequency option in the Home ribbon specifies the period over which to sample the data from a time series. The frequency displayed in the ribbon determines what frequency of data is displayed in the Chart (not the other way around). Automatic frequency is determined by looking at the range of the date axis and the number of data points. When the points get too squished, the frequency becomes less granular (the opposite is also true).
Fluctuations become less pronounced when switching to less granular frequencies because the data is aggregated and the aggregated values do not necessarily have the same highs or lows.

The following examples use different frequencies to plot the time series of Apple's closing prices. The Dataset renderer is set to points so that you can see each individual plot point.

  1. The frequency is set to automatic, and the Chart is zoomed in to display only a couple of months at a time. At this range, the plot can comfortably display granular data without being too overcrowded, so the frequency automatically displays daily data:
  2. The frequency is still set to automatic, but this time the Chart is zoomed all the way out to display the entire time series. At this range, if the frequency were still daily, all the points would be crowded together and therefore hard to distinguish. Chart thus switches to a less granular frequency and displays quarterly data instead of daily.
  3. The frequency is manually set to Daily (it is no longer automatically set). When zoomed to the same range as in #1, the screenshot looks identical (since both frequencies are showing daily data). However, if we then manually change the frequency to Monthly, the plot becomes less granular, and the fluctuations become less pronounced because the data is aggregated monthly and the aggregated values do not necessarily have the same highs or lows.
    Daily Frequency:

    Monthly Frequency:
  4. The frequency is manually set to Daily and the plot is zoomed out to display the entire time series. Notice that the points are completely overlapping and indistinguishable from each other. This level of granularity does not work for the large date range and large number of data points.

    Instead, if we change the frequency to Yearly, the granularity decreases, the plot points become easy to discern, but the fluctuations become much less pronounced because the Chart is aggregating the data per year.

For more information, see Working with Time Series Data.

Editing Chart Expressions from the Main Expression Bar

To directly edit a Chart expression from the main expression bar (as opposed to the Dataset contextual tab) select a dataset legend bubble in your Chart, this switches the expression bar to edit series mode (the dataset legend bubble appears in the expression bar indicating you are in edit mode).

If you change the expression and hit enter, the dataset changes. (Press Esc if you don't want to save your changes.)

Deselect the dataset legend bubble in your plot to return to add series mode. When in Add series mode, if you enter a new expression in the bar, Chart will add that series to the plot, and will not change any of the previously added expressions.

Keyboard Shortcuts

See Keyboard Shortcuts.

Example

The following example uses the Chart you created in the Getting Started example to demonstrate the concept of variables.

  1. Open MSFT vs. AAPL (the Chart document you created in the Getting Started example).
  2. Switch to the Tree view of the Variables perspective and bind the MSFT expression as a variable by double clicking the node in the tree. Rename the variable instrumentVariable. Do the same for the AAPL expression and name the variable instrumentVariable2.
  3. Next, bind the Chart Title to a variable. In the expression bar for that varaible, enter instrumentVariable.toString() + " versus " + instrumentVariable2.toString(). This sets the variable to be the string of the first variable and the string value of the second varaible. In other words the chart title is now "Microsoft Corp versus Apple Inc."

  4. Now, if you chance the value of either of the instrument variables, the chart will update accordingly. For example, change the first variable to AMZN.

    You can manipulate other labels (such as the dataset label) using the same methods and binding different nodes in the tree. For more information on variable see, Variables Perspective.

Previous Versions

Chart 4.1

Axis Font Size Variable

You can now bind the axis font size as a variable in the Variables Perspective. Note that this applies to the Chart application, as well as the Chart widget in Dashboard.

Chart 4.0

Text Annotation Variables

You can now access variables created through the Variables perspective directly in Text Annotations (previously you had to bind variables through the Variables panel in the Annotation contextual ribbon). To reference a variable, use @variableName notation in the text box in the Compose panel.

As a result of this change, the Variables panel in the Annotation contextual ribbon has been removed.
Previous documents that rely on the old Variables panel will still load, though with a warning that the document is using legacy text annotations.

Interval Annotation Variables

You can now bind the start, end, and intervals of an Interval Annotation in the Variables perspective. The feature works in the Chart application, as well as the Chart widget in Dashboard.

Automatic Font Size

Chart can now automatically set the size of the range axis labels to best fit the plot. This Auto size option is found in the Formatting panel of the Axis contextual tab. Previously saved documents will load with the specific size; newly created documents will default to Auto.

Right Click Individual Item in a Collection

You can now right click an individual series in a plotted collection for action items specific to that individual series. Previously the right click menu would provide action items for only the collection as a whole. You can still access action items for the collection as a whole by right clicking the collection legend bubble.

Stacked Region Color Selection

You can now select colors for each series in a stacked plot; previously, Chart would automatically display all the series in a collection as a gradient. This option is found in the Dataset contextual tab: choose a series from the drop-down menu and then select a color for that series (as seen in the screenshots below).

For more information about what is new in the platform, see Version History.

Related Links

Need Help? Email us at           © 2014 Palantir Technologies  ·  Terms of Use  ·  Privacy and Security Statement