Spotfire: How to set Combination Chart Series color? IronPython C#

             combinationChart.ColorAxis.Coloring.Clear();

            var categories = combinationChart.ColorAxis.Coloring.AddCategoricalColorRule().GetExplicitCategories();

            foreach (var categoryKey in categories)

            {

// Your business rules here ...

                if(categoryKey.ToString().Contains("completion"))

                    combinationChart.ColorAxis.Coloring.SetColorForCategory(categoryKey, ColorTranslator.FromHtml("#17295f"));

                else if(categoryKey.ToString().Contains("location"))

                    combinationChart.ColorAxis.Coloring.SetColorForCategory(categoryKey, ColorTranslator.FromHtml("#f51908"));

                else

                    combinationChart.ColorAxis.Coloring.SetColorForCategory(categoryKey, ColorTranslator.FromHtml("#232323"));

            }


Comments

Popular posts from this blog

WPF How to Dispose ViewModel when the associated UserControl (Not Window) closes?

C# How to unit test Dispatcher

WPF: How to Deep Copy WPF object (e.g. UIElement) ?