Skip to main content
Version: 1.0.0

Line Chart with Missing Data

Tracks changes in a variable over time, even when there are gaps in the data. This allows for the visualization of trends and patterns in the data, even when some data points are missing. It is useful for analyzing time series data, such as stock prices, sales figures, or temperature readings.

Chart:


Code:

  const { muze, getDataFromSearchQuery } = viz;

  const data = getDataFromSearchQuery();

  const ColumnField = "Maker";
  const RowField = "Miles_per_Gallon";

  muze
    .canvas()
    .rows([RowField])
    .columns([ColumnField])
    .layers([
      {
        mark: "line",
        connectNullData: true,
        nullDataLineStyle: {
          stroke: "grey",
        },
      },
    ])
    .data(data)
    .mount("#chart") // mount your chart