OhlcSeries Style

2 posts, 1 answers
  1. BENOIT CHEVALIER
    BENOIT CHEVALIER avatar
    22 posts
    Member since:
    Nov 2009

    Posted 12 Apr 2012 Link to this post

    Hi,

    I'm trying to change the color of the OhlcSeries lines, which works fine most of the time. However, I've found that if the Open, High, Low and Close values are all the same (for example trade was suspended and therefore the values didn't move), instead of showing just a line, nothing is displayed. If I don't override the UpStroke and DownStroke Color then the line does display. Example images showing this.

    What could I be doing wrong here?

    My style:
    <Style TargetType="chartView:OhlcSeries">
                <Setter Property="DefaultVisualStyle">
                    <Setter.Value>
                        <Style TargetType="chartView:OhlcStick">
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="UpStroke" Value="White" />
                            <Setter Property="DownStroke" Value="White" />
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
  2. Answer
    Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 17 Apr 2012 Link to this post

    Hello Benoit,

    I see from your images and code snippet that you set the Ohlc series style correctly. However you should add MinHeight for the Ohlc stick in the style (by default it is 1). Here's how the Style should look like:

    <Style TargetType="telerik:OhlcSeries" x:Key="ohlcStyle">
                <Setter Property="DefaultVisualStyle">
                    <Setter.Value>
                        <Style TargetType="telerik:OhlcStick">
                            <Setter Property="MinHeight" Value="1"/>
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="UpStroke" Value="White" />
                            <Setter Property="DownStroke" Value="White" />
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>


    All the best,
    Evgenia
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
Back to Top