# Last point on chart linked to first point sometimes

**URL:** <https://talk.observablehq.com/t/last-point-on-chart-linked-to-first-point-sometimes/3109>\
**Category:** Uncategorized\
**Created:** [April 20, 2020, 5:40pm UTC](https://talk.observablehq.com/t/last-point-on-chart-linked-to-first-point-sometimes/3109 "2020-04-20T17:40:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![funkyfonk](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/funkyfonk/32/2796_2.png) [@funkyfonk](https://talk.observablehq.com/u/funkyfonk)\
**Post date:** [April 20, 2020, 5:40pm UTC](https://talk.observablehq.com/t/last-point-on-chart-linked-to-first-point-sometimes/3109/1 "2020-04-20T17:40:30Z")

</div>

I have a strange behavior I can’t reproduce.

Sometimes my graph displays cleanly, and a simple reload makes it weird with a straight line between last point and first point.

 ![screenshot](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/f/f6443672b2c9628e843747dee9070d6d81a87202.png)

(I can post only 1 image, so just the bad one !)

Any idea to avoid that ?

Is it because my JSON data are not sorted ?

---

<div class="post-metadata">

**Author:** ![jzhang621](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jzhang621/32/2840_2.png) [@jzhang621](https://talk.observablehq.com/u/jzhang621)\
**Post date:** [April 20, 2020, 5:58pm UTC](https://talk.observablehq.com/t/last-point-on-chart-linked-to-first-point-sometimes/3109/2 "2020-04-20T17:58:26Z")

</div>

Thanks for reaching out.

Are you able to share your notebook or post the relevant code so we can take a look at why this is happening?

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [April 20, 2020, 9:47pm UTC](https://talk.observablehq.com/t/last-point-on-chart-linked-to-first-point-sometimes/3109/3 "2020-04-20T21:47:46Z")

</div>

> [@funkyfonk](#):
>
> Is it because my JSON data are not sorted ?

That’d be my guess, too!

---

<div class="post-metadata">

**Author:** ![funkyfonk](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/funkyfonk/32/2796_2.png) [@funkyfonk](https://talk.observablehq.com/u/funkyfonk)\
**Post date:** [April 21, 2020, 8:43am UTC](https://talk.observablehq.com/t/last-point-on-chart-linked-to-first-point-sometimes/3109/4 "2020-04-21T08:43:27Z")

</div>

That was it! I thought X-Axis would be magically ordered and graph by time.  
I keep learning, thanks !
