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

Chartview Series Opacity

2 Answers 136 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 12 Mar 2012, 11:00 PM
Hello.

In the past, I used to use the Chart control but migrated a few months ago to the ChartView control due to the memory leak associated with the Chart control.  Everything has been great, the only problem I've found is that I used to be able to specify the opacity of the series (for when different series would overlap) like this:

<telerik:LineSeries Stroke="#FF51B0DD" StrokeThickness="2" Opacity="0.6"/>


This no longer works with the ChartView control.  Any ideas why or what I can do to re-enable this behavior? 

2 Answers, 1 is accepted

Sort by
0
Accepted
Bartholomeo Rocca
Top achievements
Rank 1
answered on 13 Mar 2012, 12:35 PM
Hello Nick,

You can either use the alpha value of the color like this:
<telerik:RadCartesianChart>
    <telerik:LineSeries StrokeThickness="4" Stroke="#9951B0DD">
        <telerik:LineSeries.DataPoints>
            <telerik:CategoricalDataPoint Category="C1" Value="1" />
            <telerik:CategoricalDataPoint Category="C2" Value="3" />
            <telerik:CategoricalDataPoint Category="C3" Value="2" />
            <telerik:CategoricalDataPoint Category="C4" Value="7" />
            <telerik:CategoricalDataPoint Category="C5" Value="2" />
        </telerik:LineSeries.DataPoints>
    </telerik:LineSeries>
 
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis />
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis />
    </telerik:RadCartesianChart.VerticalAxis>
</telerik:RadCartesianChart>

Or you can specify the SolidColorBrush.Opacity property like this:
<telerik:RadCartesianChart>
    <telerik:LineSeries StrokeThickness="4">
        <telerik:LineSeries.Stroke>
            <SolidColorBrush Color="#51B0DD" Opacity="0.3" />
        </telerik:LineSeries.Stroke>
                 
        <telerik:LineSeries.DataPoints>
            <telerik:CategoricalDataPoint Category="C1" Value="1" />
            <telerik:CategoricalDataPoint Category="C2" Value="3" />
            <telerik:CategoricalDataPoint Category="C3" Value="2" />
            <telerik:CategoricalDataPoint Category="C4" Value="7" />
            <telerik:CategoricalDataPoint Category="C5" Value="2" />
        </telerik:LineSeries.DataPoints>
    </telerik:LineSeries>
 
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis />
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis />
    </telerik:RadCartesianChart.VerticalAxis>
</telerik:RadCartesianChart>


Greetings,
Bart.
0
Nick
Top achievements
Rank 1
answered on 13 Mar 2012, 06:51 PM
Works great.  Thanks!
Tags
ChartView
Asked by
Nick
Top achievements
Rank 1
Answers by
Bartholomeo Rocca
Top achievements
Rank 1
Nick
Top achievements
Rank 1
Share this question
or