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

Custom ChartPalette random behaviours ..?

2 Answers 42 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Chinmaya
Top achievements
Rank 1
Chinmaya asked on 22 Sep 2014, 08:03 AM
I have a chart with 8 point series in that and i have defined custom palette as below
<.......XML....>

 <telerik:ChartPalette x:Key="customPalette">
        <telerik:ChartPalette.SeriesEntries>

            <telerik:PaletteEntryCollection SeriesFamily="Point">                
                <telerik:PaletteEntry Fill="SandyBrown" Stroke="{x:Null}"/>
                <telerik:PaletteEntry Fill="Lime" Stroke="{x:Null}"/>
                <telerik:PaletteEntry Fill="SlateGray" Stroke="{x:Null}"/>                       
            
                <telerik:PaletteEntry Fill="SteelBlue" Stroke="{x:Null}"/>
                <telerik:PaletteEntry Fill="YellowGreen" Stroke="{x:Null}"/>
                <telerik:PaletteEntry Fill="Aquamarine" Stroke="{x:Null}"/>                           
                <telerik:PaletteEntry Fill="Violet" Stroke="{x:Null}"/>

                <!--<telerik:PaletteEntry Fill="Olive" Stroke="{x:Null}"/>-->
           

            </telerik:PaletteEntryCollection>
        </telerik:ChartPalette.SeriesEntries>
    </telerik:ChartPalette>

<.......cs code.....>

chart.Palette = App.Current.Resources["customPalette"] as ChartPalette;  

   foreach (string location in locationInfo.ParameterLocationNames)
                {
                    ObservableCollection<ParameterResult> parameterResults = new ObservableCollection<ParameterResult>();
                    dictionaryParameterResults.Add(location, parameterResults);

                        PointSeries valueSeries = new PointSeries();             
                        valueSeries.ItemsSource = parameterResults;
                        valueSeries.PointSize = new Size() { Height = 6, Width = 6 };                  
                        valueSeries.CategoryBinding = new PropertyNameDataPointBinding("Time");
                        valueSeries.ValueBinding = new PropertyNameDataPointBinding("Val");
                        valueSeries.Visibility = System.Windows.Visibility.Visible;
                        valueSeries.LegendSettings = new SeriesLegendSettings();
                        valueSeries.LegendSettings.Title = location.Replace(locationInfo.Name + ".", "");
                        
                        chart.Series.Add(valueSeries);
               }

as you see now for 8 series i have only 7 palette colors defined and in this case 1st and 8th series have same color.
if i define one more color and make 8 colors in palette then chart is using only first 4 colors and repeating the same colors for next 4 series

I wanted have all series in different colors

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 23 Sep 2014, 06:41 AM
Hi Chinmaya,

I was not able to reproduce the reported behavior. This is why I attached the project that I used for testing your code. Can you please take a look at it and let me know if I am missing something?

Thank you for any help you can provide.

Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Chinmaya
Top achievements
Rank 1
answered on 23 Sep 2014, 08:31 AM
Hi Martin,

Thank you very much the replay with a example.

No your example is not missing anything and now
even in my project i am not able to reproduce the behavior. If i come across the same behavior i will let you know and ill send my project.

regards,
Chinamya  
Tags
ChartView
Asked by
Chinmaya
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Chinmaya
Top achievements
Rank 1
Share this question
or