Update color of column series based on values?

We are looking to use the graph component as a live ui warning for the users of our application. We live update the values of a column series, and are looking to color code each item based on a limit, for example 0-100 red, 100-200 green, 200-300 yellow.

I had constructed SeriesBrushes = List<Color>, one per item in our graph. I can set the color initially, but they don't seem to ever change when modified

      <chart:SfChart.Series>
        <chart:ColumnSeries x:Name="popSeries" ItemsSource="{Binding Data}" XBindingPath="Name"
                            YBindingPath="Pop" LegendIcon="Rectangle" Label="Population"
                            ListenPropertyChange="{Binding ListenUpdateChange}"  EnableTooltip="True">
          <chart:ColumnSeries.ColorModel>
            <chart:ChartColorModel Palette="Custom" CustomBrushes="{Binding SeriesBrushes}">
            </chart:ChartColorModel>
          </chart:ColumnSeries.ColorModel>
        </chart:ColumnSeries>
      </chart:SfChart.Series>

Should this work, or is their a better way to programatically change the color of an item in a series live?

3 Replies

YP Yuvaraj Palanisamy Syncfusion Team September 30, 2016 03:50 AM UTC

Hi Matthew Sebastian, 
 
We have prepared a sample as per your requirement. Please find the sample from the below location, 
 
  
Thanks, 
Yuvaraj 
  
  



MS Matthew Sebastian September 30, 2016 02:17 PM UTC

It seems that reassigning the colormodel on each update is what I needed to fix my problem.

I modified the provided sample to change individual points and update their color on the timer. In the meanwhile, I had also reproduced the chart we needed by using a stackedcolumn chart with 3 series, and only using one series per column at a time.

I've attached the modified sample just for reference

Attachment: ModifiedSample_fc20f5ae.7z


JC Jaikrishna Chandrasekar Syncfusion Team October 3, 2016 12:18 PM UTC

Hi Matthew,

We had modified a sample by adding 3 stacking column series and it can be download from the below location

Sample: http://www.syncfusion.com/downloads/support/forum/126173/ze/ModifiedSample_21344766240  

Note: If the provided sample would not meet your requirement, please provide us more details about your requirement, which will help us to provide a better solution.

Regards,
Jaikrishna C

Loader.
Up arrow icon