Change color of static item

2 posts, 0 answers
  1. Henrik
    Henrik avatar
    23 posts
    Member since:
    Feb 2012

    Posted 02 Nov 2013 Link to this post

    Hello.

    I have a scenario where I need to draw a RED line as an upper marker like in this example.
    http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/staticitems/defaultcs.aspx

    The line itself is no problem, but can I change the color when making the series programically?
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 04 Nov 2013 Link to this post

    Hi Henrik,

    The main color of a series is under its Appearance inner element - the Fill Style element has a BackgroundColor property: http://www.telerik.com/help/aspnet-ajax/htmlchart-server-side-api-configure-series.html. You can set it either in markup, or in code-behind, e.g.:
    markup:
    <telerik:LineSeries>
        <Appearance>
            <FillStyle BackgroundColor="Red" />
        </Appearance>
    </telerik:LineSeries>
    code-behind:
    LineSeries ls = new LineSeries();
    ls.Appearance.FillStyle.BackgroundColor = System.Drawing.Color.Red;



    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top