This is a migrated thread and some comments may be shown as answers.

Unable to set ColorField to specific colour on ScatterLine RadHTMLChart

2 Answers 235 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 29 Jan 2015, 08:09 PM
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 Answers, 1 is accepted

Sort by
0
Kyle
Top achievements
Rank 1
answered on 29 Jan 2015, 09:12 PM
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>
0
Danail Vasilev
Telerik team
answered on 30 Jan 2015, 09:45 AM
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.

 
Tags
Chart (HTML5)
Asked by
Kyle
Top achievements
Rank 1
Answers by
Kyle
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or