Pre loader

CategoryDateTimeAxis: Annotation placement

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


Hello support team,

I’m using a SciChartSurface Chart with a CategoryDateTimeAxis (xAxis).
The chart should contain three stacked bar columns and Annotations between the columns.

How can I place the Annotations exactly between the columns with consideration of the dynamic width of chart surface? I haven’t found the exactly property or solution for this particular case.

Thanks for your support in advanced!

  • You must to post comments

Hi Miriam,

I’m not sure the requirement you want is possible with SciChart WPF.

Firstly, the CategoryAxis requires that x-Values on axis or annotations are set to an index of your data. In SciChart WPF this index is an integer or rounded to integer, meaning that annotation.X1 can only fall on whole round number (0, 1, 2, 3) and align with a data-point.

Secondly, there is no exposed API to get the available width between two columns.

However, if you switch to NumericAxis or DateTimeAxis then you could place an annotation between data-points. You could also estimate the gap between columns by using FastColumnRenderableSeries.DataPointWidth. The DataPointWidth is a fraction of available space occupied by a column. e.g. for a DateTimeAxis if two datapoints are 1 hour apart, and DataPointWidth = 0.7, then the gap between two columns will be equal to 2(1 - 0.7) = 0.6 hours

So try this. Try placing columns on a DateTimeAxis or NumericAxis, setting DataPointWidth = 0.7 then placing your Annotations half way between data-points with X1, X2 0.6 apart

Best regards

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.