xyzzer / WinRTXamlToolkit

WinRT XAML Toolkit
Other
282 stars 67 forks source link

no way to rotate through the pallete in a bar/column chart? #24

Open gardnerjr opened 8 years ago

gardnerjr commented 8 years ago

Pie chart appears to be the only chart that "rotates" through a single series, assigning distinct colors to each piece?

The other charts just use the first color form the palette until you switch to a stacked version of those charts, and then each group uses a color?

Is there any (easy) way to get the behavior from pie chart anywhere else? there doesn't seem to be. I tried to fake this by making sets of series that don't overlap, but ran into issues where SeriesDefinitions isn't bindable, so i can't generate those from bindings, and the way everything is set up i can't generate all the charts manually from code.

xyzzer commented 8 years ago

You can do anything because it's open source. I haven't written or used the chart control much (only ported it from Silverlight Toolkit), but it seems like when you add another series to a line chart - the other series (line) shows up in the second color of the palette. What exactly are you trying to achieve that doesn't work for you?

On Sat, Mar 19, 2016 at 12:15 PM, John Gardner notifications@github.com wrote:

Pie chart appears to be the only chart that "rotates" through a single series, assigning distinct colors to each piece?

The other charts just use the first color form the palette until you switch to a stacked version of those charts, and then each group uses a color?

Is there any (easy) way to get the behavior from pie chart anywhere else? there doesn't seem to be. I tried to fake this by making sets of series that don't overlap, but ran into issues where SeriesDefinitions isn't bindable, so i can't generate those from bindings, and the way everything is set up i can't generate all the charts manually from code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/xyzzer/WinRTXamlToolkit/issues/24

gardnerjr commented 8 years ago

i'm trying to do "small multiples" of bar or column charts where each bar/column is a different color, and (ideally) synchronize color values _between _the charts, so the same item in each chart is the same color, even if there are items missing in one chart. But the bar/column charts appear to only use one color from the palette.

I tried using stackedbar/column, and like i said, you can't bind to SeriesDefinitions, so you can't dynamically bind to create series. Likewise, Series is not bindable in Chart either. so you can't bind to that either. the only way to create a chart with multiple series is to hard-code it up front in xaml, or to do it all in code. You can only bind the ItemsSource within any series to change the points in that series.

So far, it looks like what i'm trying to do is improbable, as PieDataPoint has a lot of extra code so that each individual datapoint has its own resources. none of the other datapoints do that, they get all their style from the series itself.

Instead of binding to series/etc, and having the charts defined inside a template, i might need to have the template just define a ContentControl/ContentPresenter, and have my code build all the charts and just bind the chart.

xyzzer commented 8 years ago

I think someone mentioned once trying to bind data point's color to the data. That could work.

Sent from Outlook Mobile

On Sun, Mar 20, 2016 at 10:41 AM -0700, "John Gardner" notifications@github.com wrote:

i'm trying to do "small multiples" of bar or column charts where each bar/column is a different color, and (ideally) synchronize color values _between _the charts, so the same item in each chart is the same color, even if there are items missing in one chart. But the bar/column charts appear to only use one color from the palette.

I tried using stackedbar/column, and like i said, you can't bind to SeriesDefinitions, so you can't dynamically bind to create series. Likewise, Series is not bindable in Chart either. so you can't bind to that either. the only way to create a chart with multiple series is to hard-code it up front in xaml, or to do it all in code. You can only bind the ItemsSource within any series to change the points in that series.

So far, it looks like what i'm trying to do is improbable, as PieDataPoint has a lot of extra code so that each individual datapoint has its own resources. none of the other datapoints do that, they get all their style from the series itself.

Instead of binding to series/etc, and having the charts defined inside a template, i might need to have the template just define a ContentControl/ContentPresenter, and have my code build all the charts and just bind the chart.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub