Pre loader

How to horizontally offset a bar from StackedColumnRenderableSeries

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

My goal: Cumulate several values over a time span and show them as stacked bars, where the bars should be located exactly over the time span.

Current situation: Bars are always centered around the x value of the datapoint.

Question: How can bars be shifted to the left? In the attached picture the blue bars represent the current situation, the yellow bars are drawn by offseting the x values by -0.5s. The latter is what I wanted to achieve. Is there an easier approach I havn’t seen so far?

Thanks for your support!

Images
  • You must to post comments
0
0

I know this was asked 8 years ago but as it was so long ago I was wondering if the situation has changed?

Is it possible to offset the columns so that the value they represent on the x-axis is aligned with either the left or right edge of the column instead of the centre?

  • You must to post comments
0
0

Hi,

Unfortunately, there isn’t an inbuilt support for this feature. It was requested a few times, and we have a task for it, but it isn’t with a high priority though. You can try creating a custom series class by inheriting FastColumnRenderableSeries and overriding the GetColumnCenterTopAndBottom(..) method there.

Inside you can access a data point using renderPassData.PointSeries, where variables are passed as params, and you can use coordinate calculators for data point to pixels transformation, like
renderPassData.XCoordinateCalculator.GetCoordinate(point.X).

Please, find more info on coordinate transformation API here: Axis APIs – Convert Pixel to Data Coordinates

Hope this helps! Please, feel free to ask if you need any assistance,

Best regards,
Yuriy

  • jengel
    Thanks for your reply. I vote for a property which allows to set the bar anchor (left, center, right) with respect to the x-coordinate :-) For the moment I will not try your approach as I've already modified the view model content for the demonstration I gave you. Never the less, thanks for the hints for the way to go.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies