Unique values for x-axis in a number chart

I have a numbers table with a bunch of values in a column, and a count of the respective value in another column. If I am plotting this in a chart, how can I make sure that the values in the one of the column (x-axis) is used uniquely?

Here is a simplistic example of what I have:

enter image description here

How can I make it so that the x-axis only show Apples and Bananas as to bars, and the total count on the y-axis? Do I need to create a separate table to do that calculation and plot that table? Is there any better/elegant way of handling this?

Snap chart to grid or place a chart in a cell?

Is there a way to snap charts to the grid?

In my spreadsheet, my chart hangs a little below my table, but I would like the chart to expand/contract with the cells on the left.

If this is an easy answer, I assure you I’ve spend a decent amount of time searching Google, the documentation, and the spreadsheets themselves

** Alternative answers are welcome

*** Still looking for an answer to this. Even a definite “not possible” would be helpful at this point

Sample Image: Pie Chart Hangs Below Grid

What kind of chart is this?

This is not a donut chart.. not showing distribution here. These are different attributes contributing to the total score (in the middle)

Chart Type

Another example: enter image description here

The thickness of the wedge is proportionate to the severity of the alert type.

Is there any other chart that works well for this type of data?

Google Sheets – How to preserve colors of each series from changing when inserting new data in Chart Editor?

This issue occurs on every chart type. As an example, I have a pie chart created from a long table of data where each column is assigned a specific text color, so each slice of the pie corresponds to the color of that column. I maintain this color coding on various other graphs of the same data to aid in reading the data.

When I insert a new column into the table data, I want to assign it a new color, and have its slice take that color. The new data is inserted into the series of the pie chart. However, the series will not keep their assigned colors, instead the inserted series will take the color of the series that was in its place, causing a domino effect as every series after will shift its color. The last series will have a new color. As such all the slices in the chart after the inserted slice will no longer correspond to the color of its column.

Chart before and after inserting new data

I then have to manually change each series back to its original assigned color which is extremely time-consuming and frustrating every time I want to insert new data.

How can I preserve the color of each slice/series so that the colors don’t all change when I insert new data?

Is this attack type chart correct?

I am wondering if this chart showing the types of attacks in 5e-dnd and what things they can count towards is correct:

(source1)

The chart works by listing on the y-axis different ways of making an attack and then along the x-axis it lists different phrases features throughout the books use. If something on the y-axis satisfies that condition on the x-axis their box is green, if not, the box is red. Several have descriptions explaining their content as I felt it might be necessary/helpful. The two Yellow boxes are yellow because the answer is conditional (not simply yes or no).

I have chosen to avoid talking about spells in this chart mostly because they would take up quite a few columns/rows, and also because they do not seem to cause people nearly as much confusion as the other types of attacks.

For the purposes of this I would like three things to be assumed. This is so I can know if the main part of the chart is correct and not the sections that have been put up to debate previously on this Stack:

  1. That using a weapon to make an improvised attack removes all of its properties including melee/ranged. Thus throwing a bow at somebody would not be considered an attack with a ranged weapon, because the bow has lost that property, similarly throwing a mace at somebody would not be considered an attack with a melee weapon.

  2. From the same question as above, that improvised attacks transform whatever is being used to make them into weapons for the purpose of that attack. Thus using a table-leg or shield in an improvised attack would momentarily make each of them count as a weapon.

  3. That you cannot use a weapon for a shove or grapple so they do not qualify as attacks with weapons. (A question where the answer was iffy)

1 – Note that the source may change after this posting as it is a Google Doc. For the sake of this question, use the image I have embedded here.

Open Pie Chart/Donut Chart in R using Plotly with count and percentage

I’m trying to make a donut chart in R using plotly. I tried ggplot, but it wasn’t able to give me the effect that I need. Here’s a sample dataset:

library(dplyr) testfile <- tibble(personID = 1:10,                    status = c("bad", "good", "bad", "bad", "bad", "bad", "bad", "bad", "bad", "good"),                    department = c("sales", "sales", "marketing", "sales", "marketing", "management", "management", "sales", "sales", "sales")) 

This chart will end up in a PowerPoint, so it does not need to be responsive. Instead, I need the pie chart to say, without scrolling over it, the % that falls into each status and the count. Also, in the center of the pie chart, I want it to say the % that are in the “good” category.

This is the code that I have so far. It has the percentage visible without scrolling but not the count and it does not have the percentage in the center.

library(plotly) p <- testfile %>%   group_by(status) %>%   summarize(count = n()) %>%   plot_ly(labels = ~status, values = ~count) %>%   add_pie(hole = 0.6) %>%   layout(title = "Ratio of Good to Bad",  showlegend = F,          xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = TRUE),          yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = TRUE)) 

Also, if you could show how to facet_wrap it by department, that would be very helpful. I keep getting it to say NULL!

Thank you!