website logo
👥 Community🎯 Samples on GitHub🚦System Status
💡 Guides
🚀 Examples
🍕 Developer Reference
⚡️ Changelog
🎥 Video Library
Navigate through spaces
⌘K
Examples Overview
Setting up your solution
Jig Types
Components
Datasource
Actions
Preview
Widgets
Expressions
Aggregation
Boolean
Comparison Operators
Date & Time
Path Operators
Functional Programming
Jigx Variables
Predicate Queries
String
Docs powered by
Archbee
Components
charts

bar-chart

7min

The component can display statistics related to data records (categorical variables). This can show a single or multiple data series for comparative purposes. This component is mostly used in jig.default or jig.list.

Bar Chart Preview
Bar Chart Preview


Configuration options

Some properties are common to all components, see Common component properties for a list and their configuration options.



Core structure



yAxis

min and max values that display on the y-axis. The max property doesn't have to be defined, in this case, it will automatically be calculated depending on your data.

xAxis

categories to display on the x-axis

series

data - values to be used in the chart color - defines the color of the bar used in the chart

Other options



chart

title and subtitle - Name and a short description of your chart height and width - The parameters of the graph displayed (in pixels)

yAxis

labels - Selection of different formats such as currency, numberStyle, compactDisplay and notation. tickAmount - The number of ticks that should be displayed on the y-axis.

xAxis

labels - Selection of different formats such as dateFormat, currency, unit, and signDisplay. tickAmount - The number of ticks to display on the x-axis. min and max - Minimum and maximum values that should be displayed on the x-axis. isFirstLabelHidden value is either true to hide the first label or false to display the first label. The property doesn't have to be defined, by default the first label is shown. isFirstTickHidden: value is either true/false. isHidden: value is either true/false. isLastLabelHidden: value is either true to hide the last label or false to display the last label. The property doesn't have to be defined, by default the last label is shown. isLastTickHidden: value is either true/false. minPadding - create padding on the x and y axis for example, 0.02 (x-axis) and 0.05 (y-axis)

plotOptions

series - Different properties available to manipulate the data shown in the bar such as width of columns, the interval between two points, option to hide markers.

series

name - The naming of the actual series

legend

isHidden - The setting of a boolean value if the legend (naming of the series) should be displayed under the chart.

Examples and code snippets 

Bar-chart finance static

Finance bar-chart
Finance bar-chart


The widget displays an annual overview of finances. The x-axis shows the months and the y-axis the monetary amount. Using number formatting, we can have any currency displayed.

Examples: See the full code sample using static data in GitHub. See the full code sample using dynamic data in GitHub.

Datasources: See the full datasource code sample for dynamic data in GitHub.

bar-chart (static)
bar-chart (dynamic)
datasources (dynamic)
|
children:
  - type: component.bar-chart
    options:
      chart:
        title:
          text: "12 months overview"
        height: 260
        isAnimated: false
      legend:
        isHidden: true
      yAxis:
        min: 0
        labels:
          format:
            numberStyle: currency
            currency: USD
            compactDisplay: short
            notation: compact
        tickAmount: 5
        isFirstTickHidden: false
        isFirstLabelHidden: false
      series:
        - data: =@ctx.datasources.finance-dynamic
          name: "2021/2022"
          color: color2


Bar-chart multiple series

Multiple series
Multiple series


The  displays a bar chart with four series that compares amounts for three years per quarter. In this example the Legend is shown.

Examples: See the full code sample using static data in GitHub. See the full code sample using dynamic data in GitHub.

Datasources in order series1 and series2: See the full datasource code sample for dynamic data series 1 and series 2 in GitHub.

bar-chart-multiple (static)
bar-chart-multiple (dynamic)
datasources (dynamic)
|
title: Multiple series
type: jig.default
# Define the data to be used in the chart
datasources:
  multi:
    type: datasource.static
    options:
      data:
        - Q1: 12000
          Q2: 48000
          Q3: 36000
          Q4: 12000
          Year: "2020"
        - Q1: 34000
          Q2: 22000
          Q3: 40000
          Q4: 51000
          Year: "2021"
        - Q1: 25000
          Q2: 32000
          Q3: 45000
          Q4: 86000
          Year: "2019"              

children:
  - type: component.bar-chart
    options:
      chart:
        height: 250
      legend:
        isHidden: false
        # Define the format, labels to display on the y axis
      yAxis: 
        max: 90000
        min: 0
        labels:  
          format:
            currency: USD
            numberStyle: currency
            compactDisplay: short
            notation: compact
        tickAmount: 8
      # Define the data categories to display on the x axis   
      xAxis:   
        categories: =@ctx.datasources.multi.Year
        # Define the data to show in the bars on the chart known as the series. 
      series: 
        - data: =@ctx.datasources.multi.Q1
          name: Q1
          color: color2
          
        - data: =@ctx.datasources.multi.Q2
          name: Q2
          color: color3
         
        - data: =@ctx.datasources.multi.Q3
          name: Q3
          color: color4
          
        - data: =@ctx.datasources.multi.Q4
          name: Q4
          color: color5


See also

  • Developer reference
  • Related examples (Github)





Updated 21 Sep 2023
Did this page help you?
PREVIOUS
charts
NEXT
pie-chart
Docs powered by
Archbee
TABLE OF CONTENTS
Configuration options
Core structure
Other options
Examples and code snippets
Bar-chart finance static
Bar-chart multiple series
See also
Docs powered by
Archbee
Copyright © 2023 Jigx, Inc. All rights reserved. Terms of Service