Stacked Bar Widget Chart of the Graphist plugin

Use the Stacked Bar Chart to get your bar chart to stack the series bars on top of each other easily.

An example of the Graphist Stacked Bar Chart

You can add and edit this example using the Stacked Bar Chart widget of the Elementor editor.

Graphist widget

Drag the widget to a page using the editor to start customizing. In the left pane of the editors, you can customize the widget to the style of your site. Each of the tabs presented a specific group of settings:

Content Tab

On the Content tab of the Stacked Bar Chart Elementor widget, you can manage the grid and graph settings, edit the title and description.

Title settings

Title settings of charts
  • Show title – the toggle to enable/disable the display of the title on the current chart.
  • Title – the field to input a title text.

Description settings

Description settings of charts
  • Show description – the toggle to enable/disable the display of the description on the current chart.
  • Description – the field to input a description text.
  • Show description after title – the toggle allows you to display the description after the title or if it off – after the graph.

Data type

The option that allows you to choose the type of data you want to use to build the chart. The available data types are:

  • Statistical – provides manual data entry for each line.
  • Dynamic – provides dynamic data input using the shortcode. Once you have selected Dynamic data in the Data type select Shortcode in the Dynamic Tags
Shortcode in Dynamic Tags settings

Click on the selected field and enter the Default shortcode

 [stacked_bar_chart]

The example of the shortcode with the default data:

add_shortcode('stacked_bar_chart', 'stacked_bar_chart_shortcode');

function stacked_bar_chart_shortcode(){

   $mas= [ 
       'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'HZ'], 
       'color' => ['red', 'black', 'blue', 'gray', 'white'], 
       'bar_width' => 30, 
       'series' => [
           [12, 9, 7, 8, 5],
           [2, 1, 3.5, 7, 3], 
          [1, 3, 4, 5, 6], 
          [3, 5, 6, 7, 8] 
       ]
    ]; 

    return json_encode($mas);
}

Add the sample of code to the function.php file of your theme and change the values according to your needs. You need to change the appropriate values ​​to create a shortcode with your own сhart values:

  • The ‘stacked_bar_chart’ in the first line is the name of shortcode and you need to change it your unique name
  • labels‘ – names of labels along the x-axis. Сhange the parameters in brackets [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘HZ’ ] to yours.
  • color‘ – colors of the bar chart. Сhange the parameters in brackets [‘red’, ‘black’, ‘blue’, ‘gray’,’white’] to yours.
  • ‘bar_width’ – specify the bar width. Сhange the parameters “30” to yours.
  • ‘series’ – specify point values ​​for each bar of the chart. Values ​​for each bar are wrapped in square brackets.

Number of lines and graph labels

Chart label list

Number of lines and graph labels

Chart label list
  • Number of bars per series – the field to specify the number of bars in the one chart series. The number of bars depends on the number of data types used. Increasing the number, the new items are added automatically after the content settings.
  • Chart label list – add labels for the X-axis via the “Add Item” button. The items can be deleted, copied or ordered by dragging.

Chart Settings

  • Show grid X – the toggle to enable/disable the display of the grid along the X-axis
  • Show label X – the toggle to enable/disable the display of the labels for the X-axis. The labels can be added via items of the Chart label list
  • Show grid Y – the toggle to enable/disable the display of the grid along the Y-axis.
  • Show label Y – the toggle to enable/disable the display of the labels for the Y-axis. The numerical step along the Y-axis is displayed automatically depending on the data you entered for each of a line.
  • Bar width – specify the width of the bars for the chart
  • Chart сonventions – the toggle to enable/disable the display of the chart сonventions on the current chart.
  • Title graph сonventions – the field to input text for a chart сonventions title. Leave the field blank to display the chart сonventions without a title. The option is available if the Chart сonventions toggle is enabled.
  • Show animation – the toggle to enable/disable the animation for the current chart.
  • Speed animation – specify the speed animation for the existing graph appearance. The option is available if the Show animation toggle is enabled.

Item Settings

To add a certain number of bars per series for the existing chart, you need to specify the corresponding number in the settings “The number of lines on the chart” Each new item is added as a new tab at the end of the Content section.

The tabs with line settings

The item has such options:

  • Item name – specify the data name you want to display with this line
  • Line color – specify color and transparency of the line using the color picker
  • Bar chart value – add bar values ​​for each series using the “Add Item” button. The items can be deleted, copied or ordered by dragging.

Style Tab

On the styles tab, you can configure everything related to the visual style of the Stacked Bar Chart title, description, and conventions elements: colors, typography, alignment, margins, and more.

Header

  • Typography – a group of settings controls everything about typography: family, font-size, font-weight, line-height and other parameters of the current section.
Typography settings
Typography settings of the Graphist
  • Shadow – the setting creates a shadow from the text and it can be adjusted according to your needs specifying color, blur, horizontal and vertical shift.
Text shadow settings of the Graphist
  • ColorSpecify the font color and opacity for the text of the current block using the color picker.
Font color settings of the Graphist
  • Alignment – manage the alignment( left, center, right ) of block text for desktop, tablet or mobile.
Text alignment of the Graphist
  • Margin – the setting allows managing the margin of the block in different units(px, em, %) for desktop, tablets or phones.
Margin settings of the Graphist

Description

  • Typography – a group of settings controls everything about typography: family, font-size, font-weight, line-height and other parameters of the current section.
  • ColorSpecify the font color and opacity for the text of the current block using the color picker.
  • Alignment – manage the alignment( justify, left, center, right ) of block text for desktop, tablet or mobile.
  • Margin – the setting allows managing the margin of the block in different units(px, em, %) for desktop, tablets or phones.

Conventions

  • Typography – a group of settings controls everything about typography: family, font-size, font-weight, line-height and other parameters of the current section.
  • Shadow – the setting creates a shadow from the text and it can be adjusted according to your needs specifying color, blur, horizontal and vertical shift.
  • ColorSpecify the font color and opacity for the text of the current block using the color picker.
  • Alignment – manage the alignment( left, center, right ) of block text for desktop, tablet or mobile.
  • Margin – the setting allows managing the margin of the block in different units(px, em, %) for desktop, tablets or phones.

List conventions

  • Typography – a group of settings controls everything about typography: family, font-size, font-weight, line-height and other parameters of the current section.
  • ColorSpecify the font color and opacity for the text of the current block using the color picker.
  • Alignment – manage the alignment( left, center, right ) of block text for desktop, tablet or mobile.
  • Margin – the setting allows managing the margin of the block in different units(px, em, %) for desktop, tablets or phones.

Labels

  • Typography – a group of settings controls everything about typography: family, font-size, font-weight, line-height and other parameters of the current section.
  • Colorspecify the font color and opacity for the text of the labels using the color picker.

Advanced Tab

The settings in the advanced tab Worker Elementor widget allow you to flexibly configure everything that relates to the design of the plug-in wrapper. The settings on this tab are entirely similar to the native Elementor widgets and will be convenient for experienced users of the Elementor. Learn more about Advanced Tab settings from Elmentor’s official documentation.

Save changes

Do not forget to save changes after completing the widget setup. To do this, click on the Update button at the bottom of the page.

Update page in the Elementor
Update page in the Elementor

Hosting for Elementor websites

Fast and reliable hosting is significant for any WordPress site. We recommend all our customers use SiteGround WordPress Hosting. Many unique settings and features make this hosting the number 1 for WordPress: Free Website Transfer, Staging Tools, Free SSL, CDN, and much more for 3.95/mo.

Was this article helpful to you?