# How to create multiple X axis for a single dataset in classic chart

**URL:** <https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892>\
**Category:** Ignition\
**Created:** [June 17, 2021, 2:06pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892 "2021-06-17T14:06:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 2:06pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/1 "2021-06-17T14:06:03Z")

</div>

Hi,  
I have one dataset with value

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

i want to use **3 X axis** for the single dataset in classic chart.

how to create multiple x axis for single dataset?

Please help me out

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [June 17, 2021, 2:14pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/2 "2021-06-17T14:14:52Z")

</div>

Vision or Perspective?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 2:47pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/3 "2021-06-17T14:47:43Z")

</div>

@zacht for vision

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 17, 2021, 3:07pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/4 "2021-06-17T15:07:52Z")

</div>

You can use the chart customizer to add additional axes to the chart. You will have to split your dataset, but that shouldn't be too difficult.

> [@Prevent Easy Chart Plot from Moving](http://forum.inductiveautomation.com/t/prevent-easy-chart-plot-from-moving/46289/4):
>
> So the simplest way to achieve this is to use the Standard Chart Components Chart Customizer. Add an additional Dataset Add an additional X-Axis Configure the Axis Location to be on the TOP Add an additional Y-Axis Configure the Axis Location to be on the Right Assign the X and Y axis to the dataset in the Dataset Properties Tab Once you’ve done this all you need to do is generate the two datasets of data and assign them. The new dataset will appear as a custom property on the chart com…

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [June 17, 2021, 3:08pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/5 "2021-06-17T15:08:03Z")

</div>

Do you have a picture or example of what you want the chart to look like? I’m having trouble picturing three X-axes for this data.

Regardless of how the final product will look, it appears that the Chart component is set up to set axis designation by dataset. The easiest thing might be to store this dataset as a custom property and make several smaller datasets (maybe using [system.dataset.filterColumns](https://docs.inductiveautomation.com/display/DOC81/system.dataset.filterColumns) and [runScript](https://docs.inductiveautomation.com/display/DOC81/runScript)) on which you can manipulate the axis designation in the Chart Customizer. The big dataset would be disabled in the Chart Customizer. The smaller datasets would control what is viewed.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 3:13pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/6 "2021-06-17T15:13:03Z")

</div>

Thanks I will checj your scripting

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/7 "2021-06-17T15:15:42Z")

</div>

Actually I am using system.tag.query for getting The data for plotting… For each tag I am using diffent timing system tag query. After geting the second dataset, I adding the value row of second dataset to first dataset column…so I am getting only one dataset with timestamp of first dataset.

So I am actually planing to show diffent x axis for second tag…

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 17, 2021, 3:19pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/8 "2021-06-17T15:19:25Z")

</div>

Just a note, generally the X-Axis is the Time Axis, and each tag would be given it’s own Y-Axis, Assuming the units/scaling change per tag.

Using multiple X-Axis is possible, just unconventional, so requires a bit more setup than otherwise.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 3:22pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/9 "2021-06-17T15:22:20Z")

</div>

```auto
current_data = event.source.parent.getComponent('Chart').Data
print current_data
#system.dataset.deleteRow(current_data, 22060)
#offset = 5
endTime = system.date.now()
endTime = system.date.addMinutes(endTime, 0)
startTime = system.date.addMinutes(endTime, -180)
print startTime, endTime
#current_data.getRowCount()
dataSet = system.tag.queryTagHistory(paths=['[MQTT Engine]Edge Nodes/Robertsbridge/Line/Additives/Dry Additives/Stucco/Feed System_1/Material/Flow_PV'], startDate=startTime, endDate=endTime, returnSize=current_data.getRowCount(), aggregationMode="Average", returnFormat='Wide')
print dataSet

columnName = str(tag.getValueAt(0, 0))
colCount = current_data.getColumnCount()
columnData = []

for i in range(dataSet.getRowCount()):
	columnData.append(dataSet.getValueAt(i,1))
	
dataSet = system.dataset.addColumn(current_data, colCount, columnData, columnName, float)
event.source.parent.getComponent('Chart').Data = dataSet

```

this is the script i am using to add row value of second dataset with first dataset column  
from that can able to plot x axis for second tag?  
its possible to hide y axis correct?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 17, 2021, 3:28pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/10 "2021-06-17T15:28:44Z")

</div>

If you want to plot multiple values they must share at least 1 value, by default in Ignition the X-Axis is shared and that Axis usually represents time.

The dataset you are showing would easily be charted where t\_stamp is represented as the X-Axis and each value column is then shown as a tag value. What is the purpose of multiple X-Axis in reference to the dataset you have shown?

Are you trying to create a chart where the Y-Axis is the shared Time Axis?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 3:30pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/11 "2021-06-17T15:30:41Z")

</div>

What is the purpose of multiple X-Axis in reference to the dataset you have shown?  
because this is the reason **After geting the second dataset, I adding the value row of second dataset to first dataset column…so I am getting only one dataset with timestamp of first dataset.**  
so i want to show the second dataset timestamp in the separate x axis. so they will understand  
yes timestamp only i want to show in x axis  
i am applying offset to the second tag… so timestamp of second tag will be different. that i want to show in separate axis

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 17, 2021, 3:33pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/12 "2021-06-17T15:33:18Z")

</div>

> [@prasath.t](#):
>
> **After geting the second dataset, I adding the value row of second dataset to first dataset column…so I am getting only one dataset with timestamp of first dataset.**  
> so i want to show the second dataset timestamp in the separate x axis. so they will understand

You will need two separate datasets in order to make this work, or three if you want three separate X-Axis with Independent Y-Axis.

I really, really struggle with the Idea that you need more than one time axis, after all Time is Time.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 17, 2021, 4:03pm UTC](https://forum.inductiveautomation.com/t/how-to-create-multiple-x-axis-for-a-single-dataset-in-classic-chart/47892/14 "2021-06-17T16:03:11Z")

</div>

@lrose I will try to use separate dataset for each tag. Thanks for your time
