# Histogram in XY Chart

**URL:** <https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 2, 2024, 11:51am UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821 "2024-05-02T11:51:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KAVINAYA\_L](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@KAVINAYA\_L](https://forum.inductiveautomation.com/u/KAVINAYA_L)\
**Post date:** [May 2, 2024, 11:51am UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/1 "2024-05-02T11:51:33Z")

</div>

Hi Team,

I am currently facing an issue where I am unable to generate the histogram correctly. Could anyone please guide me on what mistakes I might have made

please find the attached chart

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e149df7ca09024bc490d20d70f3d44f72caa0acf.png)

```python
[
  {
    "type": "ia.chart.xy",
    "version": 0,
    "props": {
      "xAxes": [
        {
          "name": "line",
          "label": {
            "enabled": true,
            "text": "line",
            "color": ""
          },
          "visible": true,
          "tooltip": {
            "enabled": true,
            "text": "",
            "cornerRadius": 3,
            "pointerLength": 4,
            "background": {
              "color": "",
              "opacity": 1
            }
          },
          "inversed": false,
          "render": "category",
          "category": {
            "break": {
              "enabled": false,
              "startCategory": "",
              "endCategory": "",
              "size": 0.05
            }
          },
          "date": {
            "baseInterval": {
              "enabled": false,
              "timeUnit": "hour",
              "count": 1,
              "skipEmptyPeriods": false
            },
            "range": {
              "max": "",
              "min": "",
              "useStrict": false
            },
            "break": {
              "enabled": false,
              "startDate": "",
              "endDate": "",
              "size": 0.05
            },
            "inputFormat": "yyyy-MM-dd kk:mm:ss",
            "format": "M/d"
          },
          "value": {
            "range": {
              "max": "",
              "min": "",
              "useStrict": false
            },
            "logarithmic": false,
            "break": {
              "enabled": false,
              "startValue": 0,
              "endValue": 100,
              "size": 0.05
            },
            "format": "#,###.##"
          },
          "appearance": {
            "opposite": false,
            "inside": false,
            "labels": {
              "color": "",
              "opacity": 1,
              "rotation": 0,
              "verticalCenter": "middle",
              "horizontalCenter": "middle"
            },
            "grid": {
              "color": "",
              "opacity": 1,
              "dashArray": "",
              "minDistance": 60,
              "position": 0.5
            },
            "font": {
              "size": "",
              "weight": 500
            }
          }
        }
      ],
      "yAxes": [
        {
          "name": "num",
          "label": {
            "enabled": true,
            "text": "num",
            "color": ""
          },
          "visible": true,
          "tooltip": {
            "enabled": true,
            "text": "",
            "cornerRadius": 3,
            "pointerLength": 4,
            "background": {
              "color": "",
              "opacity": 1
            }
          },
          "inversed": false,
          "render": "value",
          "category": {
            "break": {
              "enabled": false,
              "startCategory": "",
              "endCategory": "",
              "size": 0.05
            }
          },
          "date": {
            "baseInterval": {
              "enabled": false,
              "timeUnit": "hour",
              "count": 1,
              "skipEmptyPeriods": false
            },
            "range": {
              "max": "",
              "min": "",
              "useStrict": false
            },
            "break": {
              "enabled": false,
              "startDate": "",
              "endDate": "",
              "size": 0.05
            },
            "inputFormat": "yyyy-MM-dd kk:mm:ss",
            "format": "M/d/yyyy HH:mm:ss"
          },
          "value": {
            "range": {
              "max": "",
              "min": "",
              "useStrict": false
            },
            "logarithmic": false,
            "break": {
              "enabled": false,
              "startValue": 0,
              "endValue": 100,
              "size": 0.05
            },
            "format": "#,###.##"
          },
          "appearance": {
            "opposite": false,
            "inside": false,
            "labels": {
              "color": "",
              "opacity": 1,
              "rotation": 0,
              "verticalCenter": "middle",
              "horizontalCenter": "middle"
            },
            "grid": {
              "color": "",
              "opacity": 1,
              "dashArray": "",
              "minDistance": null,
              "position": 0.5
            },
            "font": {
              "size": "",
              "weight": 500
            }
          }
        },
        {
          "name": "bar",
          "label": {
            "enabled": true,
            "text": "bar",
            "color": ""
          },
          "visible": true,
          "inversed": false,
          "tooltip": {
            "enabled": true,
            "text": "",
            "cornerRadius": 3,
            "pointerLength": 4,
            "background": {
              "color": "",
              "opacity": 1
            }
          },
          "render": "value",
          "category": {
            "break": {
              "enabled": false,
              "startCategory": "",
              "endCategory": "",
              "size": 0.05
            }
          },
          "date": {
            "baseInterval": {
              "enabled": false,
              "timeUnit": "hour",
              "count": 1,
              "skipEmptyPeriods": false
            },
            "range": {
              "max": "",
              "min": "",
              "useStrict": false
            },
            "break": {
              "enabled": false,
              "startDate": "",
              "endDate": "",
              "size": 0.05
            },
            "inputFormat": "yyyy-MM-dd kk:mm:ss",
            "format": "M/d/yyyy"
          },
          "value": {
            "range": {
              "min": "",
              "max": "",
              "useStrict": false
            },
            "logarithmic": false,
            "break": {
              "enabled": false,
              "startValue": 0,
              "endValue": 100,
              "size": 0.05
            },
            "format": "#,###.##"
          },
          "appearance": {
            "opposite": true,
            "inside": false,
            "labels": {
              "color": "",
              "opacity": 1,
              "rotation": 0,
              "verticalCenter": "middle",
              "horizontalCenter": "middle"
            },
            "grid": {
              "color": "",
              "opacity": 1,
              "dashArray": "4,4",
              "minDistance": null,
              "position": 0.5
            },
            "font": {
              "size": "",
              "weight": 500
            }
          }
        }
      ],
      "series": [
        {
          "name": "num",
          "label": {
            "text": "num"
          },
          "visible": true,
          "hiddenInLegend": false,
          "defaultState": {
            "visible": true
          },
          "data": {
            "source": "example",
            "x": "line",
            "y": "num"
          },
          "xAxis": "line",
          "yAxis": "num",
          "zIndex": 0,
          "tooltip": {
            "enabled": true,
            "text": "{name}: [bold]{valueY}[/]",
            "cornerRadius": 3,
            "pointerLength": 4,
            "background": {
              "color": "",
              "opacity": 1
            }
          },
          "render": "line",
          "candlestick": {
            "open": {
              "x": "",
              "y": ""
            },
            "high": {
              "x": "",
              "y": ""
            },
            "low": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "fill": {
                "color": "",
                "opacity": 1
              },
              "stroke": {
                "color": "",
                "opacity": 1,
                "width": 1
              },
              "stacked": false,
              "deriveFieldsFromData": {
                "fill": {
                  "color": "",
                  "opacity": ""
                },
                "stroke": {
                  "color": "",
                  "opacity": "",
                  "width": ""
                }
              },
              "heatRules": {
                "enabled": false,
                "max": "",
                "min": "",
                "dataField": ""
              }
            }
          },
          "column": {
            "open": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "fill": {
                "color": "",
                "opacity": 1
              },
              "stroke": {
                "color": "",
                "opacity": 1,
                "width": 1
              },
              "stacked": false,
              "width": null,
              "height": null,
              "deriveFieldsFromData": {
                "fill": {
                  "color": "",
                  "opacity": ""
                },
                "stroke": {
                  "color": "",
                  "opacity": "",
                  "width": ""
                }
              },
              "heatRules": {
                "enabled": false,
                "max": "",
                "min": "",
                "dataField": ""
              }
            }
          },
          "line": {
            "open": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "connect": true,
              "tensionX": 1,
              "tensionY": 1,
              "minDistance": 0.5,
              "stroke": {
                "width": 3,
                "opacity": 1,
                "color": "",
                "dashArray": ""
              },
              "fill": {
                "opacity": 0,
                "color": ""
              },
              "bullets": [
                {
                  "enabled": false,
                  "render": "circle",
                  "width": 10,
                  "height": 10,
                  "label": {
                    "text": "{value}",
                    "position": {
                      "dx": 0,
                      "dy": 0
                    }
                  },
                  "fill": {
                    "color": "",
                    "opacity": 1
                  },
                  "stroke": {
                    "color": "",
                    "opacity": 1,
                    "width": 1
                  },
                  "rotation": 0,
                  "tooltip": {
                    "enabled": true,
                    "text": "{name}: [bold]{valueY}[/]",
                    "cornerRadius": 3,
                    "pointerLength": 4,
                    "background": {
                      "color": "",
                      "opacity": 1
                    }
                  },
                  "deriveFieldsFromData": {
                    "fill": {
                      "color": "",
                      "opacity": ""
                    },
                    "stroke": {
                      "color": "",
                      "opacity": "",
                      "width": ""
                    },
                    "rotation": ""
                  },
                  "heatRules": {
                    "enabled": false,
                    "max": 100,
                    "min": 2,
                    "dataField": ""
                  }
                }
              ]
            }
          },
          "stepLine": {
            "open": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "connect": true,
              "tensionX": 1,
              "tensionY": 1,
              "minDistance": 0.5,
              "stroke": {
                "width": 3,
                "opacity": 1,
                "color": "",
                "dashArray": ""
              },
              "fill": {
                "opacity": 0,
                "color": ""
              },
              "bullets": [
                {
                  "enabled": true,
                  "render": "circle",
                  "width": 10,
                  "height": 10,
                  "label": {
                    "text": "{value}",
                    "position": {
                      "dx": 0,
                      "dy": 0
                    }
                  },
                  "fill": {
                    "color": "",
                    "opacity": 1
                  },
                  "stroke": {
                    "color": "",
                    "opacity": 1,
                    "width": 1
                  },
                  "rotation": 0,
                  "tooltip": {
                    "enabled": true,
                    "text": "{name}: [bold]{valueY}[/]",
                    "cornerRadius": 3,
                    "pointerLength": 4,
                    "background": {
                      "color": "",
                      "opacity": 1
                    }
                  },
                  "deriveFieldsFromData": {
                    "fill": {
                      "color": "",
                      "opacity": ""
                    },
                    "stroke": {
                      "color": "",
                      "opacity": "",
                      "width": ""
                    },
                    "rotation": ""
                  },
                  "heatRules": {
                    "enabled": false,
                    "max": 100,
                    "min": 2,
                    "dataField": ""
                  }
                }
              ]
            }
          }
        },
        {
          "name": "bar",
          "label": {
            "text": "bar"
          },
          "visible": true,
          "hiddenInLegend": false,
          "defaultState": {
            "visible": true
          },
          "data": {
            "source": "example",
            "x": "line",
            "y": "bar"
          },
          "xAxis": "line",
          "yAxis": "bar",
          "zIndex": 0,
          "tooltip": {
            "enabled": true,
            "text": "{name}: [bold]{valueY}[/]",
            "cornerRadius": 3,
            "pointerLength": 4,
            "background": {
              "color": "",
              "opacity": 1
            }
          },
          "render": "column",
          "candlestick": {
            "open": {
              "x": "",
              "y": ""
            },
            "high": {
              "x": "",
              "y": ""
            },
            "low": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "fill": {
                "color": "",
                "opacity": 1
              },
              "stroke": {
                "color": "",
                "opacity": 1,
                "width": 1
              },
              "stacked": false,
              "deriveFieldsFromData": {
                "fill": {
                  "color": "",
                  "opacity": ""
                },
                "stroke": {
                  "color": "",
                  "opacity": "",
                  "width": ""
                }
              },
              "heatRules": {
                "enabled": false,
                "max": "",
                "min": "",
                "dataField": ""
              }
            }
          },
          "column": {
            "open": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "fill": {
                "color": "",
                "opacity": 1
              },
              "stroke": {
                "color": "",
                "opacity": 1,
                "width": 1
              },
              "stacked": false,
              "width": null,
              "height": null,
              "deriveFieldsFromData": {
                "fill": {
                  "color": "",
                  "opacity": ""
                },
                "stroke": {
                  "color": "",
                  "opacity": "",
                  "width": ""
                }
              },
              "heatRules": {
                "enabled": false,
                "max": "",
                "min": "",
                "dataField": ""
              }
            }
          },
          "line": {
            "open": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "connect": true,
              "tensionX": 1,
              "tensionY": 1,
              "minDistance": 0.5,
              "fill": {
                "opacity": 0,
                "color": ""
              },
              "stroke": {
                "width": 3,
                "opacity": 1,
                "color": "",
                "dashArray": ""
              },
              "bullets": [
                {
                  "enabled": false,
                  "render": "circle",
                  "width": 10,
                  "height": 10,
                  "label": {
                    "text": "{value}",
                    "position": {
                      "dx": 0,
                      "dy": 0
                    }
                  },
                  "fill": {
                    "color": "",
                    "opacity": 1
                  },
                  "stroke": {
                    "color": "",
                    "opacity": 1,
                    "width": 1
                  },
                  "rotation": 0,
                  "tooltip": {
                    "enabled": true,
                    "text": "{name}: [bold]{valueY}[/]",
                    "cornerRadius": 3,
                    "pointerLength": 4,
                    "background": {
                      "color": "",
                      "opacity": 1
                    }
                  },
                  "deriveFieldsFromData": {
                    "fill": {
                      "color": "",
                      "opacity": ""
                    },
                    "stroke": {
                      "color": "",
                      "opacity": "",
                      "width": ""
                    },
                    "rotation": ""
                  },
                  "heatRules": {
                    "enabled": false,
                    "max": 100,
                    "min": 2,
                    "dataField": ""
                  }
                }
              ]
            }
          },
          "stepLine": {
            "open": {
              "x": "",
              "y": ""
            },
            "appearance": {
              "connect": true,
              "tensionX": 1,
              "tensionY": 1,
              "minDistance": 0.5,
              "fill": {
                "opacity": 0,
                "color": ""
              },
              "stroke": {
                "width": 3,
                "opacity": 1,
                "color": "",
                "dashArray": ""
              },
              "bullets": [
                {
                  "enabled": true,
                  "render": "circle",
                  "width": 10,
                  "height": 10,
                  "label": {
                    "text": "{value}",
                    "position": {
                      "dx": 0,
                      "dy": 0
                    }
                  },
                  "fill": {
                    "color": "",
                    "opacity": 1
                  },
                  "stroke": {
                    "color": "",
                    "opacity": 1,
                    "width": 1
                  },
                  "rotation": 0,
                  "tooltip": {
                    "enabled": true,
                    "text": "{name}: [bold]{valueY}[/]",
                    "cornerRadius": 3,
                    "pointerLength": 4,
                    "background": {
                      "color": "",
                      "opacity": 1
                    }
                  },
                  "deriveFieldsFromData": {
                    "fill": {
                      "color": "",
                      "opacity": ""
                    },
                    "stroke": {
                      "color": "",
                      "opacity": "",
                      "width": ""
                    },
                    "rotation": ""
                  },
                  "heatRules": {
                    "enabled": false,
                    "max": 100,
                    "min": 2,
                    "dataField": ""
                  }
                }
              ]
            }
          }
        }
      ],
      "dataSources": {
        "example": [
          {
            "bar": 0,
            "line": 19.118,
            "num": 0
          },
          {
            "bar": 0,
            "line": 19.14,
            "num": 2
          },
          {
            "bar": 0,
            "line": 19.162,
            "num": 4
          },
          {
            "bar": 0,
            "line": 19.184,
            "num": 6
          },
          {
            "bar": 0,
            "line": 19.206,
            "num": 8
          },
          {
            "bar": 0,
            "line": 19.228,
            "num": 10
          },
          {
            "bar": 14,
            "line": 19.25,
            "num": 12
          },
          {
            "bar": 14,
            "line": 19.272,
            "num": 14
          },
          {
            "bar": 4,
            "line": 19.294,
            "num": 16
          },
          {
            "bar": 15,
            "line": 19.316,
            "num": 18
          },
          {
            "bar": 3,
            "line": 19.338,
            "num": 20
          },
          {
            "bar": 0,
            "line": 19.36,
            "num": 22
          },
          {
            "bar": 0,
            "line": 19.382,
            "num": 24
          },
          {
            "bar": 0,
            "line": 19.404,
            "num": 26
          },
          {
            "bar": 0,
            "line": 19.426,
            "num": 28
          },
          {
            "bar": 0,
            "line": 19.448,
            "num": 30
          },
          {
            "bar": 0,
            "line": 19.47,
            "num": 20
          }
        ]
      }
    },
    "meta": {
      "name": "XYChart_0"
    },
    "position": {
      "basis": "375px"
    },
    "custom": {}
  }
]

```

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 2, 2024, 11:58am UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/2 "2024-05-02T11:58:44Z")

</div>

How do you want it to look? Which fields are supposed to be on the X and Y axes?

---

<div class="post-metadata">

**Author:** ![KAVINAYA\_L](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@KAVINAYA\_L](https://forum.inductiveautomation.com/u/KAVINAYA_L)\
**Post date:** [May 2, 2024, 12:00pm UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/3 "2024-05-02T12:00:50Z")

</div>

Hi,

Thanks for the reply

i need it to look like this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/28df9ee09e13bcb320b937dbc9a8657bff3cdf18.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 2, 2024, 12:10pm UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/4 "2024-05-02T12:10:21Z")

</div>

It seems to be accurately plotting the data you gave it. Turn on the bullets to see the datapoints.  
`series.0.line.appearance.bullets.enabled : true`

`datasources.example` "num" field is increasing linearly except for the last value.

---

<div class="post-metadata">

**Author:** ![KAVINAYA\_L](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@KAVINAYA\_L](https://forum.inductiveautomation.com/u/KAVINAYA_L)\
**Post date:** [May 2, 2024, 12:19pm UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/5 "2024-05-02T12:19:02Z")

</div>

Hi ,

I think I mistakenly assigned the wrong series values for the 'line' component. It should be adjusted to align with my expectations. Specifically, I need to develop a histogram chart with 'bar' and 'line' values.

Thank you

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 2, 2024, 12:24pm UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/6 "2024-05-02T12:24:11Z")

</div>

Still not clear.

1. Are the X-axis and it's labels correct on your original post?
2. What do 'line', 'bar' and 'num' represent?

Can you do an Excel mockup and screengrab showing the columns of data and a chart?

---

<div class="post-metadata">

**Author:** ![KAVINAYA\_L](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@KAVINAYA\_L](https://forum.inductiveautomation.com/u/KAVINAYA_L)\
**Post date:** [May 3, 2024, 4:39am UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/7 "2024-05-03T04:39:23Z")

</div>

hi ,  
Sorry for the oversight  
I have to draw a histogram chart with sample data. Consider 'mykey' as the values for the curve line and 'myval' for the bars in the chart

```python
[{u'normdata': u'0', u'mykey': u'19.118', u'myval': u'0'}, {u'normdata': u'0', u'mykey': u'19.14', u'myval': u'0'}, {u'normdata': u'0', u'mykey': u'19.162', u'myval': u'0'}, {u'normdata': u'2', u'mykey': u'19.184', u'myval': u'0'}, {u'normdata': u'27', u'mykey': u'19.206', u'myval': u'0'}, {u'normdata': u'214', u'mykey': u'19.228', u'myval': u'0'}, {u'normdata': u'963', u'mykey': u'19.25', u'myval': u' 14'}, {u'normdata': u'2430', u'mykey': u'19.272', u'myval': u' 14'}, {u'normdata': u'3439', u'mykey': u'19.294', u'myval': u' 4'}, {u'normdata': u'2728', u'mykey': u'19.316', u'myval': u' 15'}, {u'normdata': u'1213', u'mykey': u'19.338', u'myval': u' 3'}, {u'normdata': u'303', u'mykey': u'19.36', u'myval': u'0'}, {u'normdata': u'42', u'mykey': u'19.382', u'myval': u'0'}, {u'normdata': u'3', u'mykey': u'19.404', u'myval': u'0'}, {u'normdata': u'0', u'mykey': u'19.426', u'myval': u'0'}, {u'normdata': u'0', u'mykey': u'19.448', u'myval': u'0'}, {u'normdata': u'0', u'mykey': u'19.47', u'myval': u'0'}]

```

my expected chart with above data

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

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 3, 2024, 8:16am UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/8 "2024-05-03T08:16:40Z")

</div>

The data you have provided is a bit strange. I had to remove all the "unicode" ('u') prefixes before pasting it in. Also, all the values are being returned as strings - some with leading spaces - instead of numbers. That suggests that there is something wrong with the binding.

> **example JSON**
>
> ```python
> [
> {
> "normdata": 0,
> "mykey": 19.118,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.14,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.162,
> "myval": 0
> },
> {
> "normdata": 2,
> "mykey": 19.184,
> "myval": 0
> },
> {
> "normdata": 27,
> "mykey": 19.206,
> "myval": 0
> },
> {
> "normdata": 214,
> "mykey": 19.228,
> "myval": 0
> },
> {
> "normdata": 963,
> "mykey": 19.25,
> "myval": 14
> },
> {
> "normdata": 2430,
> "mykey": 19.272,
> "myval": 14
> },
> {
> "normdata": 3439,
> "mykey": 19.294,
> "myval": 4
> },
> {
> "normdata": 2728,
> "mykey": 19.316,
> "myval": 15
> },
> {
> "normdata": 1213,
> "mykey": 19.338,
> "myval": 3
> },
> {
> "normdata": 303,
> "mykey": 19.36,
> "myval": 0
> },
> {
> "normdata": 42,
> "mykey": 19.382,
> "myval": 0
> },
> {
> "normdata": 3,
> "mykey": 19.404,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.426,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.448,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.47,
> "myval": 0
> }
> ]
> 
> ```

> **XY Chart JSON with example JSON**
>
> ```python
> [
> {
> "type": "ia.chart.xy",
> "version": 0,
> "props": {
> "xAxes": [
> {
> "name": "line",
> "label": {
> "enabled": true,
> "text": "line",
> "color": ""
> },
> "visible": true,
> "tooltip": {
> "enabled": true,
> "text": "",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "inversed": false,
> "render": "category",
> "category": {
> "break": {
> "enabled": false,
> "startCategory": "",
> "endCategory": "",
> "size": 0.05
> }
> },
> "date": {
> "baseInterval": {
> "enabled": false,
> "timeUnit": "hour",
> "count": 1,
> "skipEmptyPeriods": false
> },
> "range": {
> "max": "",
> "min": "",
> "useStrict": false
> },
> "break": {
> "enabled": false,
> "startDate": "",
> "endDate": "",
> "size": 0.05
> },
> "inputFormat": "yyyy-MM-dd kk:mm:ss",
> "format": "M/d"
> },
> "value": {
> "range": {
> "max": "",
> "min": "",
> "useStrict": false
> },
> "logarithmic": false,
> "break": {
> "enabled": false,
> "startValue": 0,
> "endValue": 100,
> "size": 0.05
> },
> "format": "#,###.##"
> },
> "appearance": {
> "opposite": false,
> "inside": false,
> "labels": {
> "color": "",
> "opacity": 1,
> "rotation": 0,
> "verticalCenter": "middle",
> "horizontalCenter": "middle"
> },
> "grid": {
> "color": "",
> "opacity": 1,
> "dashArray": "",
> "minDistance": 60,
> "position": 0.5
> },
> "font": {
> "size": "",
> "weight": 500
> }
> }
> }
> ],
> "yAxes": [
> {
> "name": "num",
> "label": {
> "enabled": true,
> "text": "num",
> "color": ""
> },
> "visible": true,
> "tooltip": {
> "enabled": true,
> "text": "",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "inversed": false,
> "render": "value",
> "category": {
> "break": {
> "enabled": false,
> "startCategory": "",
> "endCategory": "",
> "size": 0.05
> }
> },
> "date": {
> "baseInterval": {
> "enabled": false,
> "timeUnit": "hour",
> "count": 1,
> "skipEmptyPeriods": false
> },
> "range": {
> "max": "",
> "min": "",
> "useStrict": false
> },
> "break": {
> "enabled": false,
> "startDate": "",
> "endDate": "",
> "size": 0.05
> },
> "inputFormat": "yyyy-MM-dd kk:mm:ss",
> "format": "M/d/yyyy HH:mm:ss"
> },
> "value": {
> "range": {
> "max": "",
> "min": "",
> "useStrict": false
> },
> "logarithmic": false,
> "break": {
> "enabled": false,
> "startValue": 0,
> "endValue": 100,
> "size": 0.05
> },
> "format": "#,###.##"
> },
> "appearance": {
> "opposite": false,
> "inside": false,
> "labels": {
> "color": "",
> "opacity": 1,
> "rotation": 0,
> "verticalCenter": "middle",
> "horizontalCenter": "middle"
> },
> "grid": {
> "color": "",
> "opacity": 1,
> "dashArray": "",
> "minDistance": null,
> "position": 0.5
> },
> "font": {
> "size": "",
> "weight": 500
> }
> }
> },
> {
> "name": "bar",
> "label": {
> "enabled": true,
> "text": "bar",
> "color": ""
> },
> "visible": true,
> "inversed": false,
> "tooltip": {
> "enabled": true,
> "text": "",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "render": "value",
> "category": {
> "break": {
> "enabled": false,
> "startCategory": "",
> "endCategory": "",
> "size": 0.05
> }
> },
> "date": {
> "baseInterval": {
> "enabled": false,
> "timeUnit": "hour",
> "count": 1,
> "skipEmptyPeriods": false
> },
> "range": {
> "max": "",
> "min": "",
> "useStrict": false
> },
> "break": {
> "enabled": false,
> "startDate": "",
> "endDate": "",
> "size": 0.05
> },
> "inputFormat": "yyyy-MM-dd kk:mm:ss",
> "format": "M/d/yyyy"
> },
> "value": {
> "range": {
> "min": "",
> "max": "",
> "useStrict": false
> },
> "logarithmic": false,
> "break": {
> "enabled": false,
> "startValue": 0,
> "endValue": 100,
> "size": 0.05
> },
> "format": "#,###.##"
> },
> "appearance": {
> "opposite": true,
> "inside": false,
> "labels": {
> "color": "",
> "opacity": 1,
> "rotation": 0,
> "verticalCenter": "middle",
> "horizontalCenter": "middle"
> },
> "grid": {
> "color": "",
> "opacity": 1,
> "dashArray": "4,4",
> "minDistance": null,
> "position": 0.5
> },
> "font": {
> "size": "",
> "weight": 500
> }
> }
> }
> ],
> "series": [
> {
> "name": "num",
> "label": {
> "text": "num"
> },
> "visible": true,
> "hiddenInLegend": false,
> "defaultState": {
> "visible": true
> },
> "data": {
> "source": "example",
> "x": "mykey",
> "y": "normdata"
> },
> "xAxis": "line",
> "yAxis": "num",
> "zIndex": 0,
> "tooltip": {
> "enabled": true,
> "text": "{name}: [bold]{valueY}[/]",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "render": "line",
> "candlestick": {
> "open": {
> "x": "",
> "y": ""
> },
> "high": {
> "x": "",
> "y": ""
> },
> "low": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "stacked": false,
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> }
> },
> "heatRules": {
> "enabled": false,
> "max": "",
> "min": "",
> "dataField": ""
> }
> }
> },
> "column": {
> "open": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "stacked": false,
> "width": null,
> "height": null,
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> }
> },
> "heatRules": {
> "enabled": false,
> "max": "",
> "min": "",
> "dataField": ""
> }
> }
> },
> "line": {
> "open": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "connect": true,
> "tensionX": 0.8,
> "tensionY": 1,
> "minDistance": 0.5,
> "stroke": {
> "width": 3,
> "opacity": 1,
> "color": "#385DFF",
> "dashArray": ""
> },
> "fill": {
> "opacity": 0,
> "color": ""
> },
> "bullets": [
> {
> "enabled": true,
> "render": "circle",
> "width": 10,
> "height": 10,
> "label": {
> "text": "{value}",
> "position": {
> "dx": 0,
> "dy": 0
> }
> },
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "rotation": 0,
> "tooltip": {
> "enabled": true,
> "text": "{name}: [bold]{valueY}[/]",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> },
> "rotation": ""
> },
> "heatRules": {
> "enabled": false,
> "max": 100,
> "min": 2,
> "dataField": ""
> }
> }
> ]
> }
> },
> "stepLine": {
> "open": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "connect": true,
> "tensionX": 1,
> "tensionY": 1,
> "minDistance": 0.5,
> "stroke": {
> "width": 3,
> "opacity": 1,
> "color": "",
> "dashArray": ""
> },
> "fill": {
> "opacity": 0,
> "color": ""
> },
> "bullets": [
> {
> "enabled": true,
> "render": "circle",
> "width": 10,
> "height": 10,
> "label": {
> "text": "{value}",
> "position": {
> "dx": 0,
> "dy": 0
> }
> },
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "rotation": 0,
> "tooltip": {
> "enabled": true,
> "text": "{name}: [bold]{valueY}[/]",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> },
> "rotation": ""
> },
> "heatRules": {
> "enabled": false,
> "max": 100,
> "min": 2,
> "dataField": ""
> }
> }
> ]
> }
> }
> },
> {
> "name": "bar",
> "label": {
> "text": "bar"
> },
> "visible": true,
> "hiddenInLegend": false,
> "defaultState": {
> "visible": true
> },
> "data": {
> "source": "example",
> "x": "mykey",
> "y": "myval"
> },
> "xAxis": "line",
> "yAxis": "bar",
> "zIndex": 0,
> "tooltip": {
> "enabled": true,
> "text": "{name}: [bold]{valueY}[/]",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "render": "column",
> "candlestick": {
> "open": {
> "x": "",
> "y": ""
> },
> "high": {
> "x": "",
> "y": ""
> },
> "low": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "stacked": false,
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> }
> },
> "heatRules": {
> "enabled": false,
> "max": "",
> "min": "",
> "dataField": ""
> }
> }
> },
> "column": {
> "open": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "fill": {
> "color": "#8B8585",
> "opacity": 0.5
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "stacked": false,
> "width": null,
> "height": null,
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> }
> },
> "heatRules": {
> "enabled": false,
> "max": "",
> "min": "",
> "dataField": ""
> }
> }
> },
> "line": {
> "open": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "connect": true,
> "tensionX": 1,
> "tensionY": 1,
> "minDistance": 0.5,
> "fill": {
> "opacity": 0,
> "color": ""
> },
> "stroke": {
> "width": 3,
> "opacity": 1,
> "color": "",
> "dashArray": ""
> },
> "bullets": [
> {
> "enabled": false,
> "render": "circle",
> "width": 10,
> "height": 10,
> "label": {
> "text": "{value}",
> "position": {
> "dx": 0,
> "dy": 0
> }
> },
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "rotation": 0,
> "tooltip": {
> "enabled": true,
> "text": "{name}: [bold]{valueY}[/]",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> },
> "rotation": ""
> },
> "heatRules": {
> "enabled": false,
> "max": 100,
> "min": 2,
> "dataField": ""
> }
> }
> ]
> }
> },
> "stepLine": {
> "open": {
> "x": "",
> "y": ""
> },
> "appearance": {
> "connect": true,
> "tensionX": 1,
> "tensionY": 1,
> "minDistance": 0.5,
> "fill": {
> "opacity": 0,
> "color": ""
> },
> "stroke": {
> "width": 3,
> "opacity": 1,
> "color": "",
> "dashArray": ""
> },
> "bullets": [
> {
> "enabled": true,
> "render": "circle",
> "width": 10,
> "height": 10,
> "label": {
> "text": "{value}",
> "position": {
> "dx": 0,
> "dy": 0
> }
> },
> "fill": {
> "color": "",
> "opacity": 1
> },
> "stroke": {
> "color": "",
> "opacity": 1,
> "width": 1
> },
> "rotation": 0,
> "tooltip": {
> "enabled": true,
> "text": "{name}: [bold]{valueY}[/]",
> "cornerRadius": 3,
> "pointerLength": 4,
> "background": {
> "color": "",
> "opacity": 1
> }
> },
> "deriveFieldsFromData": {
> "fill": {
> "color": "",
> "opacity": ""
> },
> "stroke": {
> "color": "",
> "opacity": "",
> "width": ""
> },
> "rotation": ""
> },
> "heatRules": {
> "enabled": false,
> "max": 100,
> "min": 2,
> "dataField": ""
> }
> }
> ]
> }
> }
> }
> ],
> "dataSources": {
> "example": [
> {
> "normdata": 0,
> "mykey": 19.118,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.14,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.162,
> "myval": 0
> },
> {
> "normdata": 2,
> "mykey": 19.184,
> "myval": 0
> },
> {
> "normdata": 27,
> "mykey": 19.206,
> "myval": 0
> },
> {
> "normdata": 214,
> "mykey": 19.228,
> "myval": 0
> },
> {
> "normdata": 963,
> "mykey": 19.25,
> "myval": 14
> },
> {
> "normdata": 2430,
> "mykey": 19.272,
> "myval": 14
> },
> {
> "normdata": 3439,
> "mykey": 19.294,
> "myval": 4
> },
> {
> "normdata": 2728,
> "mykey": 19.316,
> "myval": 15
> },
> {
> "normdata": 1213,
> "mykey": 19.338,
> "myval": 3
> },
> {
> "normdata": 303,
> "mykey": 19.36,
> "myval": 0
> },
> {
> "normdata": 42,
> "mykey": 19.382,
> "myval": 0
> },
> {
> "normdata": 3,
> "mykey": 19.404,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.426,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.448,
> "myval": 0
> },
> {
> "normdata": 0,
> "mykey": 19.47,
> "myval": 0
> }
> ]
> }
> },
> "meta": {
> "name": "XYChart_0"
> },
> "position": {
> "height": 394,
> "width": 759,
> "basis": "375px"
> },
> "custom": {}
> }
> ]
> 
> ```

 ![XY Chart histogram](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/6/763ce834226fd89cf5d27df64df6cf23870a444a.png)

_The result._

See the AM Charts documentation on smoothing lines for more on that.  
[https://www.amcharts.com/docs/v4/chart-types/xy-chart/#Smoothed\_lines](https://www.amcharts.com/docs/v4/chart-types/xy-chart/#Smoothed_lines)

---

<div class="post-metadata">

**Author:** ![KAVINAYA\_L](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@KAVINAYA\_L](https://forum.inductiveautomation.com/u/KAVINAYA_L)\
**Post date:** [May 3, 2024, 11:01am UTC](https://forum.inductiveautomation.com/t/histogram-in-xy-chart/89821/9 "2024-05-03T11:01:21Z")

</div>

Thank you for your valuable time.
