Question: I have a dataset with timestamp info in it. I used Python/PYES package to insert the data into elastic search following the [tutorial](http://pyes.readthedocs.org/en/latest/manual/usage.html) here. 

Then, I installed Kibana in the same machine and modified the js. I have no problem opening the Kibana web page and see my data there. 

However, when I tried to create a histogram graph. It popped up the error below:

```
× Oops! FacetPhaseExecutionException[Facet [0]: (key) field [@timestamp] not found]

```

just for your information, my mapping looks like this:

```
mapping = {
 'timestamp': {
     'type': 'date'
  },
 'productNumber': {
     'type': 'string'
  },
 'manufacturer': {
     'type': 'string'
 },
 'stock': {
     'type': 'integer'
 },
 'unitPrice': {
     'type': 'float'
 }
}

```

Also, if you go to the [demo page](http://demo.kibana.org/#/dashboard) of Kibana, you can see there are @ sign in front of the timestamp column and I don't know if that is the problem. 

![enter image description here](https://i.stack.imgur.com/qxqf7.png)

Anyone has an idea what I did wrong, I want to display my data using histogram :(

Answer: 
You can implement this behaviour yourself quite easily using the internal `Move` method by extending the `ObservableCollection<T>` class. Here is a simplified example:

```
public class SortableObservableCollection<T> : ObservableCollection<T>
{
    public SortableObservableCollection(IEnumerable<T> collection) : 
        base(collection) { }

    public SortableObservableCollection() : base() { }

    public void Sort<TKey>(Func<T, TKey> keySelector)
    {
        Sort(Items.OrderBy(keySelector));
    }

    public void Sort<TKey>(Func<T, TKey> keySelector, IComparer<TKey> comparer)
    {
        Sort(Items.OrderBy(keySelector, comparer));
    }

    public void SortDescending<TKey>(Func<T, TKey> keySelector)
    {
        Sort(Items.OrderByDescending(keySelector));
    }

    public void SortDescending<TKey>(Func<T, TKey> keySelector, 
        IComparer<TKey> comparer)
    {
        Sort(Items.OrderByDescending(keySelector, comparer));
    }

    public void Sort(IEnumerable<T> sortedItems)
    {
        List<T> sortedItemsList = sortedItems.ToList();
        for (int i = 0; i < sortedItemsList.Count; i++)
        {
            Items[i] = sortedItemsList[i];
        }
    }
}

```

> 
> Thanks to @ThomasLevesque for the more efficient `Sort` method shown above
> 
> 
> 

You can then use it like this:

```
YourCollection.Sort(c => c.PropertyToSortBy);

```
```
  private void ApplySort(IEnumerable<T> sortedItems)
  {
     var sortedItemsList = sortedItems.ToList();
     for (int i = 0; i < sortedItemsList.Count; i++)
     {
        if((object)(this[i]) != (object)(sortedItemsList[i]))
           this[i] = sortedItemsList[i];
     }
  }

```

Can reduce the number of CollectionChanged events for better performance.