I need to remove labels with 0 value [LibreOffice Calc] - graph

I am creating a very basic dashboard in libreoffice Calc. Right now I am trying to create some piecharts and bar charts. I am facing similar problem with both this type of charts.
Piecharts: I have ALL the labels to the right of the chart, even if those labels have an actual value of 0. I want labels with 0 value not to be displayed.
Bar charts: Similar to Piecharts, I want the chart not to display those X values with 0.
I am using LibreOffice Calc 6.4.7.2
If anyone can help me.

Just filter the source data table
If you want to see the entire data table, you can put the filtering result in another place and build a diagram based on this trimmed data.

Related

How to edit legend labels in google spreadsheet plots?

I'm trying to plot some data in Google spreadsheet:
And as you may see all of the series are in a same column and I can't use the any of the rows as headers. My plot looks like this:
I would appreciate if you could help me know how I can edit/add legend labels.
Unfortunately I don't think the graphs were intended for your data format.
The only way I've been able to work out how to add a header is by reformatting my data so I have the header at the top of my ranges.
So I suggest you split your data into separate columns so you have;
D2:D4, E2:E4, F2:F4 etc with D1, E1, and F1 as your header and then selecting "Use row 1 as your headers." From the data menu.
Alternatively, you could add labels to the series themselves. Although not ideal, it could be quicker than reformatting your data. On the data menu, click on the three dots of a data series to bring up a menu that allows you to add a label. Unfortunately this needs to be a cell so you'll have to have that header on your sheet some where.
I had the same question this year (2021), and it looks like there's support for it now. In short, you just have to double-click on the empty legend item for the series, and it'll give you a place to put text, directly in the chart.
Here's what my chart looked like (with no series titles):
If you double-click on one, you'll get a small text input area.
Type in your series name and then press enter or click outside of the input area.
Repeat this for each series, and you should be good to go.
I had the same problem because I was selecting only the data I wanted to include in the chart and not the entire table, headers and all. When you create a chart in Google Sheets and you want to use a row or column (or both) as strings that are included in the chart's labeling, you must select the entire table before choosing the Chart command from the Insert menu.
After doing so, you may need to do all or some of the following:
Switch rows/columns if your axes are not correct
Eliminate any rows/columns that you don't want represented by editing the Data Range field in the chart editor
Select Use column A as headers or Use row 1 as headers
You could also potentially use the add labels option when clicking on the 3 dots in the series section:
Double-click on the symbols in your legend, then double-click on the symbol for the series you would like to label; you should be able to directly enter your legend label now. You can do further text formatting using the chart editor on the right.
I took them to a new sheet. first selected only the X-axis and one of the columns that will appear as one. label. In this sheet, I made all the "labels" as a header of the sheet. and added them one by one as a series. and this time it. add them as a label.
obviously this is a workaround and the bug should be fixed :) hopefully.

Plotly Multi Column Horizontal Legend

I am trying to create horizontal bar chart in in R using the plotly package. Due to the length of the legend items I would like for them to show horizontally at the top or bottom of the visual in 2 columns. Is it possible to dictate the number of columns for the legend?
I've been able to place the legend below the x axis successfully using Layout(legend = list(orientation='h')) however regardless of where I put the legend (using the x and y arguments) it is always just one long list. I've seen a github project for creating a multi column legend in js but not r.
Thanks,
This is not possible in a normal way. I think it has its own logic that determines how many place there it is and how many columns it will display then.
So I guess if you make your plot width smaller you could reach the goal that it will just display 2 column.
Also you can try to play around with the margin attribute (https://plot.ly/r/reference/#layout-margin) by setting r and l to 10 e.g.
An other idea could be to make the font-size in legend (https://plot.ly/r/reference/#layout-legend-font-size) bigger, so that it just uses two columns. Hope it helps.
I read the same github page and I thought that it is not possible, but seems to be! I only checked in Python, but I hope this will help in your endeavors in R as well as everyone in Python looking for information. Sadly, there is not a lot of information on Plotly here compared to other packages.
This solved my problem
Setting orientation='h' is not enough. You also have to put the legend items in different legendgroups, if you want them in different columns. Here is an example with legend labels:
fig = go.Figure([
go.Scatter(x=best_neurons_df['Test Size'],
y=best_neurons_df['Training Accuracy Max'],
# You can write anything as the group name, as long as it's different.
legendgroup="group2",
name='Training',
mode='markers',
go.Scatter(x=best_neurons_df['Test Size'],
y=best_neurons_df['Validation Accuracy Max'],
# You can write anything as the group name, as long as it's different.
legendgroup="group1",
layout=dict(title='Best Model Dependency on Validation Split',
xaxis=dict(title='Validation Set proportion'),
yaxis=dict(title='Accuracy'),
margin=dict(b=100, t=100, l=0, r=0),
legend=dict(x=1, y=1.01,xanchor='right', yanchor='bottom',
title='',
orientation='h', # Remember this as well.
bordercolor='black',
borderwidth=1
))
Example image

LocusZoom standalone change x-axis and use the plots in a script

I am using the standalone LocusZoom software,but I am having two problems:
I have to create a plot showing only position on the x-axis (not showing the genes). If I just use showGenes=FALSE with nothing else the genes still appear, but if I use rfrows=0 then the genes are not shown, but the problem is that also the x-axis label with the positions disappears. Is there a way to only show the position label? It looks like the only way to do this is to modify the original script...
Is there a way to use several plots created using LocusZoom in an R script to position many plots into one unique figure? (output is a pdf for now) There is an option listed in the LocusZoom webpage (http://genome.sph.umich.edu/wiki/LocusZoom_Standalone) called "prelude" but I cannot get more info on how to use it.
If you have any suggestions for either of these two issues it would be very helpful! Thanks!!

ASP.NET charts trend line

I have basic bar charts showing some value (1 value per chart) on each day. The charts are rendered using standard MS ASP.NET charts.
Now I would like to add a trend line. Has somebody done such thing and would be so kind to give me some hints how to approach this task? I know how to add a line to the chart, just would like to know whether someone already did such thing.
If I have understood the question correctly, you want to show a line graph using the same values that each bar is drawn.
You can do this by adding one more series with chart type as line to the same chart area.
Make the Y-axis for the series as secondary and keep X-axis as primary (to keep same X-axis values for both Bar & line graph). Or you can also make X-Axis of this new series as Secondary (this will show labels on top of chart area) .

Show all series' values in stacked bars mouseover (ASP.NET CHART)

I'm using the asp.net Chart control to present a stacked bars chart.
I can create a mouseover custom tooltip using this code:
series.MapAreaAttributes = "onmouseover=\"showTooltip('#VALY');\"";
... which works fine. But I can't seem to find a way to show the rest of the values for the other series in that column.
Example:
I have 2 series (Paid and Unpaid) making up a single column in the chart. When I mouseover any of the series, I want to show both the value of the moused-over series, but also the other series contained in that particular stacked column.
Can anyone point me in the right direction?
We're also using stacked bar charts - we have click through functionality, for users to drill into the data making up each point in each series : we use something like this on each data point.
series.Points[index].MapAreaAttributes = "onclick=\"window.opener.location=this.href;window.opener.focus();return false;\"";

Resources