Custom ChartPalette random behaviours ..?

3 posts, 1 answers
  1. Chinmaya
    Chinmaya avatar
    24 posts
    Member since:
    Aug 2014

    Posted 22 Sep 2014 Link to this post

    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. Answer
    Martin
    Admin
    Martin avatar
    1099 posts

    Posted 23 Sep 2014 Link to this post

    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.
     
  3. DevCraft banner
  4. Chinmaya
    Chinmaya avatar
    24 posts
    Member since:
    Aug 2014

    Posted 23 Sep 2014 in reply to Martin Link to this post

    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  
Back to Top