# Plotly.js scatter plot not displaying even after giving the x,y values as arrays

**URL:** <https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805>\
**Category:** plotly.js\
**Created:** [April 19, 2018, 7:34pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805 "2018-04-19T19:34:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkat777](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@venkat777](https://community.plotly.com/u/venkat777)\
**Post date:** [April 19, 2018, 7:34pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805/1 "2018-04-19T19:34:37Z")

</div>

Hi ,  
I am plotting the scatter plot with list of array. Which have more than 100 items.  
In each items I have given the x,y as array. But its still not working .  
I have copied the image of my object.  
Any help is appreciated.

Here is my object.  
+++++++++++++++++++++++++  
this.Data = {x: [10],  
y: [15],  
type: ‘scatter’,  
mode: ‘none’,  
marker: { color: ‘rgba(200, 50, 100, .7)’, size: 5 },  
hoverinfo: “x,y”  
name: ‘’  
}  
this.ChartData.push(this.Data);  
++++++++++++++++++++++++++++  
And Thank you so much for a such beautiful plugin.

Thank You ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/9/9f1a2ed630560da7d1de12158c5bd98968fa4c74.png)  
Venkat

---

<div class="post-metadata">

**Author:** ![venkat777](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@venkat777](https://community.plotly.com/u/venkat777)\
**Post date:** [April 19, 2018, 7:51pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805/2 "2018-04-19T19:51:08Z")

</div>

And also Can you please advise how can I draw a line Y=x line for Reference In scatter Plot.

Thank you  
Aditya Venkat

---

<div class="post-metadata">

**Author:** ![venkat777](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@venkat777](https://community.plotly.com/u/venkat777)\
**Post date:** [April 19, 2018, 8:01pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805/3 "2018-04-19T20:01:29Z")

</div>

Hi Here is my Clear picture of object.  
I am using Angular 5 for this. ![XYAxisData](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/6/6969412e301695df8a4e8ed7abc0618575c4c322.PNG)

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [April 19, 2018, 8:28pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805/4 "2018-04-19T20:28:46Z")

</div>

You’re setting `mode: 'none'`, that means you get blank trace. Try `mode: 'markers'` or `mode: 'lines'` of `mode: 'lines+markers'` or simply use our default value by removing `mode` from your traces.

---

<div class="post-metadata">

**Author:** ![venkat777](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@venkat777](https://community.plotly.com/u/venkat777)\
**Post date:** [April 19, 2018, 8:51pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805/5 "2018-04-19T20:51:42Z")

</div>

Thank You etienne for you reply. Its worked. I am able see the points.  
And I am new to the plotly . **Can you please advise how can i draw Y=x line. which comes**

 ![Y%3DXLine](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/e/eb2ce0d88290cc71e50dbb53591c042a88b748fa.PNG) **.**

Thank You Etienne for all the Help.

Thank You  
Venkat

---

<div class="post-metadata">

**Author:** ![venkat777](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@venkat777](https://community.plotly.com/u/venkat777)\
**Post date:** [April 20, 2018, 6:37pm UTC](https://community.plotly.com/t/plotly-js-scatter-plot-not-displaying-even-after-giving-the-x-y-values-as-arrays/9805/6 "2018-04-20T18:37:35Z")

</div>

Hi Eitenne,  
I got it working . I have added a new series.

var trace1 = {  
x: [1, 2, 3, 4],  
y: [10, 15, 13, 17],  
type: ‘scatter’  
};

Thank you for the Help.
