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

Programmatically applying colors to chart

1 Answer 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grégory
Top achievements
Rank 1
Grégory asked on 12 Sep 2013, 08:25 AM

 Hello,

 I'm formatting a chart from telerik reporting to make it look as one telerik chart we have in our silverlight application.

 To do so, I have applied a Skin, and then, programatically, I'm applying new color after the chart constructor initialize component has finished and the skin is applied.

  This is what i'm formatting:
 
            Color deepBlue = Color.FromArgb(255,34,85,146); // DeepBlue RGB 34; 85; 146 ARGB 255; 34; 85; 146
            // chart border
            chart.Appearance.Border.Color = deepBlue;

            Color metalOrange = Color.FromArgb(249, 158, 13); // MetalOrange 249; 158; 13
            // title letters
            chart.ChartTitle.TextBlock.Appearance.TextProperties.Color = metalOrange;

            Color lightBlue = Color.FromArgb(235, 255, 255); // LightBlue 235; 255; 255
            // chart background; original 226; 247; 255
            chart.Appearance.FillStyle.MainColor = lightBlue;

  The Telerik.Reporting.Chart chart var is the one I'm getting from the report after is constructed. The problem is that when rendering the report in PDF, none of this color changes are done.

  As a note, in a test i do, when debugging i check the colors of the chart getting the ones in the skin, the after a clear skin line, i see back the original ones and then, when set mines, i correctly saw debugging my color values set
if I clear the skin, then i see debugging the original values for the colors of the chart. 

Thanks,

1 Answer, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 17 Sep 2013, 07:18 AM
Do you use the default constructor? Generally when exporting in some viewers the default constructor is invoked.
Tags
General Discussions
Asked by
Grégory
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
Share this question
or