Metadata

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Queue Moderators

Post Reply
fbkevy
Posts: 5
Joined: Tue Mar 25, 2014 4:30 pm

Metadata

Post by fbkevy » Wed Mar 26, 2014 5:40 pm

What I would like to do is to display other metadata when the mouse rolls over it.

I have a x Time axis, and a y Price axis. However I need to display or somehow render more info like Size, Weight ...

The number of data points in several thousand. ~ 10k

There are two problems here
1. How to find the metadata from a given mouse location
2. However to render this data

Finding:
1. How can I got from the x,y info to get the metadata elsewhere. I was thinking of using a Sorted Dictionary keyed by Time. This is not ideal as there will be multiple entries. However it could be done. In this case I have to translate from the internally representation of time to my DateTime. Anyone know how to do this? Apart from this method can anyone think of another way? What would be nice is that if Points could have a Tag to something to allow me to get the metadata without searching.

Rendering:
2. I can render some info as the mouse moves in an Annotate however ideally I want some Event Markers. Since there will be a lot of them; will they work with 10k points? Really I only want to see them when zoomed up but I am not sure however this is possible. What would a sensible limit be? One way to this was to have a zoom chart at the top like in the demo. And have the bottom chart to be zoomed in and set a max zoom out value. That way I can have lots of Event Markers albeit mostly off screen.

Any advice would be great.
Kevin

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Metadata

Post by ArctionPasi » Wed Mar 26, 2014 7:45 pm

Are you using a line series (PointLineSeries) or OHLC data (StockSeries)?

In StockSeries, there's GetItemOnMouseLocation method, which returns the OHLC points at mouse coordinate. That point has various fields, like Volume. You could create an auxiliary array or list of your custom data structures, and store the array index in Volume field. You can then access your array or list by this index.

With regular line it's more difficult. Some kind of external array would be fastest. Dictionaries are not fast when item count is very high. In the external array you could have
- x value (prefer a double instead of DateTime. You can get the double from xAxis.DateTimeToAxisValue method).
- other fields you need

When you move the mouse or use LineSeriesCursor, you can seek this array and find the nearest x value. Mouse coordinate to axis value you can convert as explained here: http://forum.arction.com/viewtopic.php?f=16&t=19. A binary tree search would be most efficient I think.

I'll check the Event Marker count. Do you need to show text labels too?
LightningChart Support Team, PT

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Metadata

Post by ArctionPasi » Wed Mar 26, 2014 7:56 pm

10 k markers seem to be rendering fast without texts.
1 k markers with texts are fully usable with my laptop.
LightningChart Support Team, PT

fbkevy
Posts: 5
Joined: Tue Mar 25, 2014 4:30 pm

Re: Metadata

Post by fbkevy » Wed Mar 26, 2014 9:06 pm

I cant use the StockSeries as I need misc fields like Text etc.

I presumed the Markers were to heavy but I seem to be wrong!

Thanks for your help :)
Kevin

Post Reply