X: time values in ascending order

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
samjesse
Posts: 4
Joined: Sat Nov 05, 2022 6:52 pm

X: time values in ascending order

Post by samjesse » Sat Nov 05, 2022 6:55 pm

A table consists of 4 fields:

X: time values in ascending order
Y: numeric value - double
A: numeric value - int
B: numeric value - int
I need to create a line chart using the X,Y values. And at each of the x,y points also show a pie/circle representing the A,B values as follows:

The centre of the pie is the x,y point. The diameter of the pie is calculated from the values A and B. The pie will have 2 different coloured slices, the size of each slice is proportion to the value of A and B.

After searching the documentations of lcjs, can this be done using Lightning Charts JS? if not, how about lc.NET?

Any hints is much appriciated. Thank you

ArctionKestutis
Posts: 469
Joined: Mon Mar 14, 2016 9:22 am

Re: X: time values in ascending order

Post by ArctionKestutis » Mon Nov 07, 2022 9:16 am

A picture is worth a thousand words. It would be helpful if you included picture with such question.

If you want to ask LightningChart JS related question you should check this topic.

As for LightningChart .NET you may try searching our Demo (Interactive Examples App) with keyword 'pie' or similar. For example, that is maybe the result
PieInDemo.png
PieInDemo.png (322.47 KiB) Viewed 66 times
If you see suitable example, then you can extract it as standalone project and investigate its code.

All the best.

samjesse
Posts: 4
Joined: Sat Nov 05, 2022 6:52 pm

Re: X: time values in ascending order

Post by samjesse » Mon Nov 07, 2022 4:13 pm

Please see the attached image. When it is zoomed out, there could me few thousands of these pies on the screen.
Attachments
chart customization.png
chart customization.png (195.31 KiB) Viewed 62 times

samjesse
Posts: 4
Joined: Sat Nov 05, 2022 6:52 pm

Re: X: time values in ascending order

Post by samjesse » Mon Nov 07, 2022 4:34 pm

Here is another partial screenshot
Attachments
pieSlices.png
pieSlices.png (159.25 KiB) Viewed 62 times

ArctionKestutis
Posts: 469
Joined: Mon Mar 14, 2016 9:22 am

Re: X: time values in ascending order

Post by ArctionKestutis » Tue Nov 08, 2022 9:29 am

You could build such Pies with PolygonSeries.
In my screenshot of .NET Demo that was last example in the table, ExampleZoomable2DPie. Each pie will be combination of two PolygonSeries and then you multiple by number of pies.
I worry a little bit that thousands of PolygonSeries may have some performance issue. The lighter version would be to convert individual Pie to bitmap image and use this image as SeriesEventMarker.Symbol.Shape = SeriesMarkerPointShape.Bitmap.
How to do custom drawing (with GDI rendering) is show in ExampleCustomRendering.

samjesse
Posts: 4
Joined: Sat Nov 05, 2022 6:52 pm

Re: X: time values in ascending order

Post by samjesse » Fri Nov 11, 2022 3:54 pm

What about the multicolor histogram?
Could you please point to which methods of the LC .Net that would work?

The histogram may need to be vertical as originally posted or horisontal as shown in the attached image.
Also, does LC.net support adding markers text as shown in the horizontal histogram image?

Thanks
Attachments
histogram_multiColor.png
histogram_multiColor.png (60.06 KiB) Viewed 44 times
histogram_horizontal.png
histogram_horizontal.png (48.58 KiB) Viewed 44 times

ArctionKestutis
Posts: 469
Joined: Mon Mar 14, 2016 9:22 am

Re: X: time values in ascending order

Post by ArctionKestutis » Tue Nov 15, 2022 9:02 am

If number of bars relative small, you can use BarSeries stacking feature/property. That is, set

Code: Select all

_chart.ViewXY.BarViewOptions.Stacking = BarsStacking.Stack;
The example of such usage could be found in our Demo: ExampleStackedBars or ExampleBarsNegativeValues.
BarsStacking.jpg
BarsStacking.jpg (110.96 KiB) Viewed 32 times

Alternative, especially if number of bars is expected to be thousands, is LineCollection approach. You can find description of this Series in User Manual as well as demonstration in Demo.

Post Reply