Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying color in dynamic series #344

Open
mscherotter opened this issue Nov 24, 2018 · 1 comment
Open

Specifying color in dynamic series #344

mscherotter opened this issue Nov 24, 2018 · 1 comment
Labels

Comments

@mscherotter
Copy link

I have a stacked bar chart with dynamic series - where each series relates to a specific color - how do I bind the color of the series bars to the ColorCount.Color?
each series is a ColorCount:
public sealed class ColorCount
{
public Color Color {get;set;}
public IEnumerable Count {get;set;}

    public int Total {get;set;}
}

<chart:RadCartesianChart x:Name="Chart"> <chart:RadCartesianChart.SeriesProvider> <chart:ChartSeriesProvider Source="{Binding Colors, Mode=OneWay}" x:Name="Provider" > <chart:ChartSeriesProvider.SeriesDescriptors> <chart:CategoricalSeriesDescriptor ItemsSourcePath="Count" CategoryPath="Time" ValuePath="Count"> <chart:CategoricalSeriesDescriptor.Style> <Style TargetType="chart:BarSeries"> <Setter Property="CombineMode" Value="Stack"/> </Style> </chart:CategoricalSeriesDescriptor.Style> </chart:CategoricalSeriesDescriptor> </chart:ChartSeriesProvider.SeriesDescriptors> </chart:ChartSeriesProvider> </chart:RadCartesianChart.SeriesProvider> <chart:RadCartesianChart.HorizontalAxis> <chart:CategoricalAxis/> </chart:RadCartesianChart.HorizontalAxis> <chart:RadCartesianChart.VerticalAxis> <chart:LinearAxis/> </chart:RadCartesianChart.VerticalAxis> </chart:RadCartesianChart>

@APopatanasov
Copy link
Collaborator

Hi @mscherotter,

If you need to set a specific color for the dynamically generated BarSeries you need to use custom palette. By default the palette applies on a per series basis. On the following link from our documentation more detailed information how to achieve this:
https://docs.telerik.com/devtools/universal-windows-platform/controls/radchart/how-to/custompalette

Hope this will help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants