ag-grid Pie Chart - change the colors of the slices - ag-grid

I would like change the colors of the slices in an ag-grid Pie Chart. Is it possible? I am using React.
https://www.ag-grid.com/javascript-charts-pie-series/

I figured out the solution, which was actually obvious but I was not correctly looking. The API reference lists "fills?: string[]". All set.

Related

How to achieve this kind of heatmap / bar chart with Chart.js

I have to build a horizontal bar with chartjs. I already built a few of them but its a bit different. The chart has 2 labels for the yAxis ("Storm Risk", "Ice Risk") and hours for the xAxes. I have to print out for every hour one of these different options with different colors ("Low", "Medium", "Hight") as ye can see in the screenshot attached.
This kind of bar chart usually the values are represented by the length of the bar and its a bit different.
Any suggestion?.
Thanks
The chart you want to implement is a sort of a "heatmap". As of now (Sep. 2018), Heatmap charts are not supported out of the box by Chart.js. However, you can make one out of a stacked bar chart (in this case, probably stacked horizontal bar chart?): make each stack size equal to one another and each item backgroundColor depending on the actual values being represented. Once this is done, you can override ticks and tooltips using with according callbacks. Legend can be implemented by one more bar chart with sample values and colors.
More details can be found in a related GitHub issue: https://github.com/chartjs/Chart.js/issues/4627
Another alternative would be to use a BubbleChart. The strategy would be similar - you would need to make all bubbles same size, but override their colors. However, provided the look in the question, stacked horizontal bar chart will be more suitable.
Another option for those who are still looking is to use chartjs-chart-matrix https://chartjs-chart-matrix.pages.dev/usage.html plugin.
Example of implementation with Chart.js v3: https://www.youtube.com/watch?v=bi04BgvNY6U

How to show percentages on the pie chart in Tableau, as opposed to off of it?

In Tableau Public 10.4, I am trying to find the setting that allows me to move the percentages of the following pie chart on to the slices, versus off of them (as they currently are). Is there a way to do this?
Thanks!
You could do it manually:
http://onlinehelp.tableau.com/current/pro/desktop/en-us/annotations_marklabels_move.html
Or do it a hacky way if you want it 'automatically:
https://community.tableau.com/thread/123584

How do you add slice spacing to just the selected item of a pie chart with iOS Charts in Swift 3?

I am using the Charts library by Daniel Gindi.
I am able to set my delegate and have a function run whenever a slice is selected, but the line pieChartDataSet.sliceSpace sets the spacing for the entire chart instead of just one slice.
Here is an example of what I want to achieve:
Thanks for your help.
chartView.highlightValue(x: 0, dataSetIndex: 0)
This pieChartDataSet.sliceSpace is for highlight feature, and you just have to write code to highlight the slice you want.
Take a look at drawHighlighted() in pie chart renderer.

Round y-axis values: Dojo Chart vs Chart.js

I am using Dojo Charts to create some line graphs, and this is how the chart looks,
this id chartData: 0,0,0,0,65,223
And when I create the graph using Chart.js, this is how it is rendered
Ignore the x-axis and other things, If we look at the y-axis, the values are rounded in chart.js, looks much nicer when compared to dojo charts.
Is there an option to achieve the same in dojo charts?
Try adjusting majorTickStep, or optionally also set minorTickMarks to true and adjust minorTickStep as well.
See http://dojotoolkit.org/reference-guide/1.10/dojox/charting.html#enabling-and-disabling-tick-marks and "Axis Stepping" two sections later.

Change pie chart color in Kibana

One of my uses of Kibana is related to displaying some information in certain cases only (say when a value is unexpected and exceeds a defined range). This element is therefore either shown or hidden from the dashboard, and displaying it could be considered as displaying an alert. I would prefer if the related pie chart was filled in red, rather than the default green.
Any ideas on how to do this?
Assuming you are describing Kibana 3, if you want terms panels pie charts to use different colors, you will need to make a code change.
There is a way to have custom colors for your pie chart. In order to do that you'll need to create a "hits" panel and pick the "pie chart" as the display. The color of the pie slices will be determined by the color that you chose for the queries that they track: