Pro Pack
Docs HomeProduct SiteSupport
  • Introduction
  • Installation
  • Chart.js
    • Configuration
    • Data Binding
    • Data Labels
  • Dataset Filter Labels
    • Installation
    • Configuration
    • Data Binding
  • DataTables
    • Configuration
    • Data Binding
    • Events
    • Methods
  • Date Range Picker
    • Configuration
    • Data Binding
    • Methods
  • iCheck
    • List
      • Configuration
      • Data Binding
      • Events
    • Filter
      • Configuration
      • Data Binding
  • Select2
    • Configuration
    • Data Binding
    • Events
    • Methods
  • Sparklines
    • Installation
    • Configuration
    • Data Binding
  • Toastr
    • Configuration
  • Web Frameworks
Powered by GitBook
On this page
  • Properties
  • Datamap

Was this helpful?

  1. Chart.js

Data Binding

PreviousConfigurationNextData Labels

Last updated 3 years ago

Was this helpful?

The for Chart.js for WireBootstrap is listed below. The component expects these field names in its data configuration.

Properties

Name

Description

series[]

An array of the fields in the data that contain the metric fields to be charted. Each will become a series in on the chart.

label

The field in the data that provides the series labels. The values of this field will be displayed on the x-axis.

Datamap

Use the datamap configuration property to bind a data structure to the component.

The following example creates a bar chart showing sales for three products.

const salesData = [
    { product: "Shirts", sales: 2544 },
    { product: "Hats", sales: 1439 },
    { product: "Gloves", sales: 3849 },
]
const chart = new wire.chartjs().render("#chart", {
    type: "bar",
    data: salesData,
    datamap: {series: ["sales"], labels: "product"}
});
data map