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


Hello everybody! I’m working with FastMountainrenderableSeries, I need to paint them particularly:
I have got an annotation, that can be moved, and area of renderable series. The area, that is above the annotaion, must be painted with one color, and area below the annotation must be painted with another (see image 1). I know, that it can be done with FastBandRenderableSeries, but I don’t need to have two series. Is there any way to do this with FastMountainSeries or FastBandRenderableSeries and annotation, without extra auxiliary renderable series ?

Thanks in advance.

  • You must to post comments
Best Answer

Actually, Yuriy is right about PaletteProvider and FastMountainRenderableSeries, but also FastBandRenderableSeries is perfect for this.

If you create an XyyDataSeries, and supply X,Y0 equal to your data and Y1=0.0 at all points, it will then draw a perfect polygon above and below the zero line.

Here’s the example code


<Window x:Class="Abt.Controls.SciChart.Wpf.TestSuite.TestCases.MountainWithBandsForAboveBelowZero"
        Title="MountainWithBandsForAboveBelowZero" Height="300" Width="300">
            <RowDefinition Height="32"/>
            <RowDefinition Height="*"/>

        <StackPanel Orientation="Horizontal">
            <RadioButton Margin="6" IsChecked="{Binding ElementName=mountainSeries, Path=IsVisible, Mode=TwoWay}" Content="Show Mountain"/>
            <RadioButton Margin="6" IsChecked="{Binding ElementName=bandSeries, Path=IsVisible, Mode=TwoWay}" Content="Show BandSeries"/>

        <s:SciChartSurface Grid.Row="1">

                <s:FastMountainRenderableSeries x:Name="mountainSeries" IsVisible="False" SeriesColor="WhiteSmoke" AreaBrush="#8833FF33"/>
                <s:FastBandRenderableSeries x:Name="bandSeries" SeriesColor="WhiteSmoke" Series1Color="Transparent" BandUpColor="#8833FF33" BandDownColor="#88FF3333"/>
                <s:NumericAxis GrowBy="0.1, 0.1"/>


Code behind

using System;
using System.Windows;
using Abt.Controls.SciChart.Model.DataSeries;

namespace Abt.Controls.SciChart.Wpf.TestSuite.TestCases
    public partial class MountainWithBandsForAboveBelowZero : Window
        public MountainWithBandsForAboveBelowZero()

            var xyyData = new XyyDataSeries<DateTime, double>();

            var startTime = DateTime.Now;
            for (int i = 0; i < 100; i++)
                var x = startTime.AddDays(i);
                var y = Math.Sin(i*0.1);

                // Append X=Date, Y=Sinewave, Y1=0.0
                // the y1 value is used by FastBandRenderebleSeries as a threshold to change band colour
                xyyData.Append(x, y, 0.0);

            mountainSeries.DataSeries = xyyData; // Note MountainSeries can consume Xyy or Xy data
            bandSeries.DataSeries = xyyData; // Note Band Series requires Xyy Data

Here’s the Result

enter image description here

  • You must to post comments
Good Answer

Hi Egor,

Thank you for inquiring us. As to your question, it is possible to achieve using the PaletteProvider feature. Please take a look at this article on the topic from our Knowledgebase. Also you could find an example in our online demo.

Hope this helps,

Best regards,

  • Egor
    Hello, thak you for the fast answer. I've already used the PalleteProvider feature in my work, but there is a little trouble (I've attached image , what I have now using this method, and what I must achieve). Need I bind ZeroLineY to annotaion coordinate or there is another way to achive the expected image?
    • Guest
    • 7 years ago
    Yes, binding the ZeroLineY property should do the trick. This seems to be the easiest way. Have you met any complications with it?
  • Egor
    No, I haven't, but I wasn't sure if it was a good approach. Thank you for your advice. I'll write about the result later
  • Egor
    This method works, thank you! But there is one more question: if I want to paint lineseries and area brush with different colors, I need to rewrite draw part in InternalDraw method?
    • Guest
    • 7 years ago
    • 1
    Hi Egor, no, you need not. There is the SeriesColor property, which allows you to specify the color of the outline of MountainSeries, and the AreaColor property, which allows you to specify the color of the polygon below the mountain line.
  • You must to post comments

Attached imaged to Yuriy’s comment:

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.