# Perspective - Pivot/Contingency table

**URL:** <https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 4, 2021, 9:55am UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710 "2021-11-04T09:55:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michal.koblasa](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@michal.koblasa](https://forum.inductiveautomation.com/u/michal.koblasa)\
**Post date:** [November 4, 2021, 9:55am UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710/1 "2021-11-04T09:55:46Z")

</div>

Dear friends,  
I have to migrate the old MS Acces file, which used a very nice feature the pivot table (similar to excel).  
Do you think is there any easy way how to combine table data with the stacked bar chart.

I have to rebuild the following visual:

 ![Pivot example](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/d/bd3050571895d91764ae0ab442e60606827b806e.jpeg)

Thank you for every proposal on how to do it.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 4, 2021, 12:13pm UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710/2 "2021-11-04T12:13:21Z")

</div>

> [@michal.koblasa](#):
>
> any easy way

no xD

Use the base barchart and just rotate it,  
or you could recreate the svgs... make a view of it bind the width and x to the right values...  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/1/a1a940bce50456dfb832aa6bd3e8edf7db038b62.png)

```auto
[
  {
    "type": "ia.shapes.svg",
    "version": 0,
    "props": {
      "viewBox": "0 0 100 20",
      "elements": [
        {
          "type": "group",
          "elements": [
            {
              "type": "rect",
              "fill": {
                "paint": "#76F001"
              },
              "stroke": {
                "paint": "#000000",
                "width": "0.25"
              },
              "x": 0,
              "y": 0,
              "width": 20,
              "height": 20
            },
            {
              "type": "text",
              "text": "value",
              "x": 0,
              "y": 15
            }
          ]
        },
        {
          "type": "group",
          "elements": [
            {
              "type": "rect",
              "fill": {
                "paint": "#E5A109"
              },
              "stroke": {
                "paint": "#000000",
                "width": "0.25"
              },
              "x": 20,
              "y": 0,
              "width": 20,
              "height": 20
            },
            {
              "type": "text",
              "text": "value",
              "x": 20,
              "y": 15
            }
          ]
        }
      ]
    },
    "meta": {
      "name": "bar"
    },
    "position": {
      "x": 673,
      "y": 767,
      "height": 40,
      "width": 100
    },
    "custom": {}
  }
]

```

---

<div class="post-metadata">

**Author:** ![michal.koblasa](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@michal.koblasa](https://forum.inductiveautomation.com/u/michal.koblasa)\
**Post date:** [November 4, 2021, 1:48pm UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710/3 "2021-11-04T13:48:38Z")

</div>

Thank you,  
What is the proper way how to work with SVG (bind properties, calculate)?  
I just found MarkupEditor and I can use HTML, but when I use the expression to concatenate HTML and bind values, then the SVG is processed and destroyed on the output.  
So in the static version, I am able to use it, but I need to link dynamic properties (as you proposed).

Is there any other component or approach I am not aware of?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fcf9d0885f2fc4244100f386fd5d9480274d7f83.png)

Thank you

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 4, 2021, 2:11pm UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710/4 "2021-11-04T14:11:09Z")

</div>

Just copy everything i posted inside the root, thats the component 😉

Idk why its hidden in the perspective component browser.  
i get this by dragging in a symbol factory and deleting all the elements inside xd

---

<div class="post-metadata">

**Author:** ![michal.koblasa](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@michal.koblasa](https://forum.inductiveautomation.com/u/michal.koblasa)\
**Post date:** [November 4, 2021, 3:03pm UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710/5 "2021-11-04T15:03:25Z")

</div>

I owe you a beer, or maybe two. 😃

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 4, 2021, 3:07pm UTC](https://forum.inductiveautomation.com/t/perspective-pivot-contingency-table/52710/6 "2021-11-04T15:07:50Z")

</div>

haha no problem 🙂
