How to color the wedge diagram for Telerik Kendo website?

I am using the Telerik Kendo pie chart and I want to be able to color the wedges.

The following is an assessment of my Kendo user interface pie chart:

<script type="text/javascript"> function createChart() { jQuery("#chart").kendoChart({ theme: jQuery(document).data("kendoSkin") || "Metro", legend: { position: "bottom" }, seriesDefaults: { labels: { visible: true, format: "{0}%" } }, series: [{ type: "pie", data: [{ category: "Remaining Work", value: 75, explode: true }, { category: "CIOs", value: 2 }, { category: "Other Executives", value: 10 }, { category: "Directors and Physicians", value: 13 }] }], tooltip: { visible: true, format: "{0}%" } }); } jQuery(document).ready(function () { setTimeout(function () { createChart(); // Initialize the chart with a delay to make sure // the initial animation is visible }, 400); jQuery(document).bind("kendo:skinChange", function (e) { createChart(); }); }); </script> 

I want the rest of the work to be light gray. How to do it?

Any suggestions would be appreciated.

+6
source share
2 answers

In Kendo UI DataViz, all charts support color redefinition of themes through seriesColors . This property will accept an array of hexadecimal color strings. For instance:

 $("#chart").kendoChart({ ... seriesColors: ["#7c7c7c", ... ] }); 
+19
source
 it is an implementation from server side would be very interesting on the concept of avoiding Similar shades..please look in to the below code which iam inserting to bind the pie chart with colors If Not radChart Is Nothing Then radChart.PlotArea.EmptySeriesMessage.TextBlock.Text = strNoData radChart.SkinsOverrideStyles = False Dim seriesColors As Color() = {Color.Aqua, Color.Bisque, Color.Chartreuse, Color.Coral, Color.DarkCyan, Color.DarkKhaki, Color.DimGray, Color.Yellow, Color.LightGreen, Color.Magenta, Color.Orange, Color.Purple, Color.SaddleBrown, Color.Silver, Color.WhiteSmoke, Color.Violet, Color.RosyBrown, Color.Olive, Color.Navy, Color.IndianRed} Dim seriesPalette As New Palette("seriesPalette", seriesColors, True) radChart.CustomPalettes.Add(seriesPalette) radChart.SeriesPalette = "seriesPalette" radChart.DataBind() End If 
0
source

Source: https://habr.com/ru/post/904353/


All Articles