idyll-langidyll
DocsTutorialsGalleryEditor
menu

Overview

  • Introduction
  • Getting started
  • Markup syntax
  • HTML tags
  • Options and styles
  • Plugin system
  • Multipage template

Interactivity

  • Built-in components
  • Using components from npm
  • Make your own component
  • Scrolling and Refs

Publishing

  • Deploying to the web
  • Embedding Idyll

Useful Links

  • Github
  • Chat
  • Twitter
  • Support Us
← Back

Chart

This will display a chart.

Input:

[var name:"dataToBeCharted" value:`[
  {x: 0, y: 0.5},
  {x: 3.5, y: 0.5},
  {x: 4, y: 0},
  {x: 4.5, y: 1},
  {x: 5, y: 0.5},
  {x: 8, y: 0.5}
]` /]

[Chart type:"line" data:dataToBeCharted domain:`[0, 8]` range:`[0, 1]` /]

Output:

Props

  • type string

    The type of the chart to display, can be line, scatter, bar, pie, or time. The time type is a line chart that expects the x values in the data to be in the temporal domain.

    • Example: "scatter"
    • Default value: 'line'
  • data array

    A JSON object containing the data for this chart. It uses the victory library to handle rendering, so see those docs for more information on what types of data can be passed in.

    • Example: `[{year: 1, value: 1}, { year: 2, value: 2 }]`
  • x string

    The data property to be used for the x dimension.

    • Example: "year"
    • Default value: "x"
  • y string

    The data property to be used for the y dimension.

    • Example: "value"
    • Default value: "y"
  • domain array

    The chart extent along the x dimension.

    • Example: `[0, 1]`
    • Default value: `[0, 1]`
  • range array

    The chart extent along the y dimension.

    • Example: `[0, 1]`
    • Default value: `[0, 1]`
  • theme string

    The theme to use, e.g. grayscale or material or a custom object (see an example here)

    • Example: 'material'
    • Default value: 'grayscale'