Unable to set ColorField to specific colour on ScatterLine RadHTMLChart

3 posts, 0 answers
  1. Kyle
    Kyle avatar
    2 posts
    Member since:
    Jan 2015

    Posted 29 Jan 2015 Link to this post

    Hi,

    I am trying to set specific series to certain colours and they are not being set and just revert to the default colours chosen by Telerik.

    I am trying to set the specific colours with the following code:

                TimelineChart.PlotArea.Series[0].ColorField = "#8C1717";
                TimelineChart.PlotArea.Series[0].Name = "Very High Risks";
                TimelineChart.PlotArea.Series[1].ColorField = "red";
                TimelineChart.PlotArea.Series[1].Name = "High Risks";... and so forth

    This is not working although I believe it should.  If I change the names of the series, I get the desired changes, it is just the colours that are not the desired ones.  

    Any thoughts?


  2. Kyle
    Kyle avatar
    2 posts
    Member since:
    Jan 2015

    Posted 29 Jan 2015 in reply to Kyle Link to this post

    I am not even able to set the colour with the following

                       <telerik:ScatterLineSeries Name="High Risks" DataFieldX="Date" DataFieldY="hr" MissingValues="Interpolate" ColorField="Red">
                            <TooltipsAppearance Color="White" DataFormatString="{1} Vulnerabilities"></TooltipsAppearance>
                            <LabelsAppearance Visible="false">
                            </LabelsAppearance>
                        </telerik:ScatterLineSeries>
  3. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 posts

    Posted 30 Jan 2015 Link to this post

    Hello Kyle,

    The ColorField property is used only for a data-bound chart and it must refer to a data source field that stores the colors for each item within a series. See how it is utilized in the HtmlChart - Conditional Item Colorization online demo.

    As for changing the color of the whole series you can use the following property:

                        <telerik:LineSeries DataFieldY="SellQuantity">
                            <Appearance FillStyle-BackgroundColor="Red"></Appearance>
    ....


    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top