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

Chart 3D Color

5 Answers 61 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 03 Aug 2010, 09:05 PM
Hi all,

I am using a RadChart component and, for each data series shown, I have set a different color. When in 2D, the graphic is painted normally, but when it's is changed to 3D, the colors are back to default. For example, in 2D, the first data series has the red color, but in 3D it back to that blue default color. What should be wrong? Any ideas?

Thanks

5 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 05 Aug 2010, 10:35 AM
Hello Ricardo,

Can you give us more details how you style the data series in your application?

Thank you,
Sia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ricardo
Top achievements
Rank 1
answered on 05 Aug 2010, 05:12 PM

Hi,

thanks for reply.

Here is my code. Assume that the variables "colorList" and "legendList" are already set. The function "map" do the mapping for the series and define them according the "typeGraph" variable. In my application, the user may change the appearance of the chart from 2D into 3D and vice versa, and in every change I make a call to this function.

When in 2D, the color are set according to "colorList". In 3D it does not happen, the series are painted with the default colors (but the legends still painted with the colors in "colorList"). I hope to know what is wrong.



Private colorList As List(of Color)
Private legendList As List(of String)
  
Public Sub map(xBinding As string, bindingList As list(of string), typeGraph As ISeriesDefinition)
  
Dim mapCollection As New SeriesMappingCollection()
  
For i As Integer = 0 To bindingList.count - 1
    Dim serie As New SeriesMapping With {.SeriesDefinition = typeGraph}
    serie.legendLabel = legendList(i)
    serie.SeriesDefinition.Appearance.Stroke = New SolidColorBrush(colorList(i))
    serie.SeriesDefinition.Appearance.Fill = New SolidColorBrush(colorList(i))
    serie.itemMappings.add(New ItemMapping(_bindingList(i), DataPointerMember.YValue))
    serie.itemMappings.add(New ItemMapping(_xBinding, DataPointerMember.XValue))
    mapCollection.add(serie)
Next

chart.SeriesMappings = nmapCollection
  
End Sub

May I do another question? In this change of 2D to 3D, how I make the camera extension work?

Thank you for the help.
0
Nikolay
Telerik team
answered on 10 Aug 2010, 03:32 PM
Hi Ricardo,

The Appearance API only works with 2D series. Setting the Stroke/Fill properties would have no effect on 3D series. As for enabling the camera extension, please, have a look at our Flexible API example, which demonstrates how to add it when switching to 3D series.

Hope this helps.

Regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ricardo
Top achievements
Rank 1
answered on 10 Aug 2010, 07:16 PM

Hi again!

So, there is not another way to change the color of a 3D graph? One that should work with 2D too?

Thanks you!

0
Accepted
Nikolay
Telerik team
answered on 13 Aug 2010, 12:34 PM
Hi Ricardo,

You can change the color of 3D series by creating a custom palette in a similar way as in our demo Custom Palette example. Please, have a look at the attached sample app, which demonstrates how to achieve this.

Hope this helps.

Greetings,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Sia
Telerik team
Ricardo
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or