SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

Dear all,

I have a set of sample data from 0 to 3000.
I have a customer request where user need to visually see some particular range of data highlighting with a vertical transparent rectangle.
For exemple I need to place on a graph a rectangle if data a between 0 to 300 and an other when sample are between 700 to 800

I have seen I can do that by coloring point within a range by using the color palet as seen in your sample, but is there a way to display rectangle and bind the width of the rectangle to the particular range ?

See picture below

regards

Version
4
Images
  • You must to post comments
0
0

The best way to do this is use a BoxAnnotation.

You can place a BoxAnnotation on the chart as follows:

<s:SciChartSurface>
   <s:SciChartSurface.Annotations>
      <s:BoxAnnotation Background="#55FF1919"
                                 BorderBrush="#FF1919"
                                 BorderThickness="1"
                                 CoordinateMode="RelativeY"                                 
                                 X1="4"
                                 X2="5.5"
                                 Y1="0"
                                 Y2="1" />
   </s:SciChartSurface.Annotations>
</s:SciChartSurface>

Using CoordinateMode.RelativeY and Y-coords of 0,1 will ensure that the annotation is always stretched to fill in the Y-direction.

Best regards,
Andrew

  • sc sc
    Thnaks andrew
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.