[BarSeries - Histogram Example ] How to get right position of each bar on Histogram Chart

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
magic
Posts: 1
Joined: Fri Dec 01, 2023 3:43 am

[BarSeries - Histogram Example ] How to get right position of each bar on Histogram Chart

Post by magic » Fri Dec 01, 2023 4:42 am

Hello
I have a Question about the right position of Histogram
I modify the example of Histogram.

[GOAL]
My goal is shown the image ( attachment - intention.jpg )
- the blue box is shown the histogram value
- the Blue middle point is same with the each barseries' middle point

[Try]
[1] I add the Button to get the screen postion of x index
[2] To get X-axies value in chart - RectangleXY[] rect = _chart.ViewXY.BarSeries[0].GetBarRectangles();
[3] Convert x-axies value to screen point - _chart.ViewXY.XAxes[0].CoordToValue(rect[count].X, out coord_x_screen_axies, true);
[4] show Result
I think the calculated the result of step 2 is not same with the middle of each bar-series

[Question]
Can you advise me to get the answer about my question ?
Attachments
ExampleHistogramXY.zip
(54.59 KiB) Downloaded 148 times
intention.JPG
intention.JPG (116.78 KiB) Viewed 10033 times

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

Re: [BarSeries - Histogram Example ] How to get right position of each bar on Histogram Chart

Post by ArctionKestutis » Fri Dec 01, 2023 12:19 pm

At least some help should be in ExampleBusinessDashboard from Demo. Lower-left chart has calculation to place annotation underneath of bars.
If that does not help to resolve all the questions, please send email to Support at Lightningchart.com and introduce yourself.

Post Reply