Compare big gapped data columns in chart - charts

I have these related columns:
col1 data range 1500 - 3000
col2 data range 27 - 50
col3 data range 0 - 30
I want to show the relation between those columns in a chart. But as col1 is so far apart from the other I just see the line of col1 and the other two are barely more than a straight line at the bottom of the chart.
How can I drag them up so the values are correct but I can still see the correlation between all columns?
What I would actually need are three charts that overlay each other.
I did not find any option for this in LibreOffice Calc 3.5.4.2

There are different ways to handle differently-scaled data when creating a chart. The easiest way is to "scale" the raw data; e.g., to divide every value in col1 by 1000 and use the result as source data for the chart.
If modifying the source data is no option, you could use different scales for col1 on the one hand, col2/3 on the other. Starting with the following dummy data:
If you've selected the data series for column C, you could align the chart columns to the secondary Y axis, while columns A/B keep aligned to the primary Y axis.
LO will adapt the scale of the secondary Y axis automatically by default:
Another option would be combining a default primary Y axis with a logarithmic-scaled secondary X axis...
... resulting in:
But generally, i would refrain from combining a "normal" primary X axis with a logarithmic secondary Y scale, since such a chart will be very hard to interpret.
In any case, i would recommend to enable data labels to display the values together with the columns.
PS: All charts created with LO 4.2.3.3

Related

Indexing a grid with row and column number?

Very new to QGIS. I'm using it to analyse agricultural field microplots for research.
I need to give each field plot its own object which I've done so by using the "create grid" tool. But I need to assign a column and row number to each object in the attribute table to make it easier to sort the data. This should start in the bottom left (1:1) and ascend in row for objects above (2:1) and ascend in column for objects to the right (1:2).
I've orientated the grid to start in the bottom left and learned that by using #row_number, I can re-number the objects from 1 to the total number of objects. But I need to add column number and row number to the attribute table.
Is there a simple way of doing this?
I think the most accessible option here is using the field calculator to add two integer columns to the attribute table. For a rectilinear grid with cells_y cells in the y direction (24 in this case) the expressions are something like
floor(("id" - 1) / cells_y) + 1
where id is the attribute table column with the cell number (set automatically by Vector -> Research Tools -> Create grid or, in the OP's case, to #rownumber).
For the y index it's
cells_y + 1 - if(("id" % cells_y) = 0, cells_y, "id" % cells_y)
This is for the ones based indexing asked for here; remove the + 1 bits for zero-based. Similarly, subtracting (as is done with y here) or not subtracting (x here) the modulus part flips the directions in which the cells are numbered. This approach can also be used in PyQGIS.
There's a few grid plugins for QGIS and several similar StackOverflow questions (like this one) which may also be of interest.

Chart showing amount of numbers in dataset in Google Sheets

I have a set of 500 numbers (range A1:T25) from 1-200 that I need to put in a pie chart showing the popularity of each number from 1-200. When I try to select all of the cells and put them in a pie chart, I can see multiple slices for each number. I even tried putting the cells into a single column.
=QUERY(QUERY(ARRAYFORMULA(TRANSPOSE(SPLIT(JOIN(" ",
QUERY(A1:T25, , 10000)), " "))),
"select Col1,count(Col1) group by Col1 label count(Col1)''"),
"order by Col2 desc")
I hope your data is not uniformly distributed—pie charts with 200 slices can be hideous!
If I'm understanding your goal correctly, you don't actually want a chart of those 500 numbers, you want a chart of how often each value appears in that set. Generate a report of that data in pairs, and chart that.
For example in a cell with 200 empty cells below it, say A30 or V1, enter:
=ARRAYFORMULA(ROW(1:200))
These are your possible values, 1 to 200.
Then next to it in say, B30 or W1, enter:
=ARRAYFORMULA(COUNTIF($A$1:$T$25, "="&ROW(1:200)))
These are individual counts of how often each A column number appears in A1:T25.
Now that your values and their 'popularity' counted out, create your pie chart from that.

Tableau: Plot percentage of binary column

Simplified example: column of 'measure' data is binary 0's and 1's. The sum of the column (all the 1's summed) is 3948. The length of the column is 4567. 3948 is 86% of 4567. How do I create a bar chart showing this percentage. All I can get is a bar adding up to 100%.
I've tried absolutely everything in the percentage of dropdown, calculated fields, online tutorials, etc.
Two approaches:
Right click on your measure field on whichever shelf you placed it. Choose Quick Table Calc -> Percentage of Total. Experiment with different settings for "Compute Using" and read about addressing and partitioning of table calculations to learn how to specify percent of "what".
Or create a calculated field specific to your problem defined as below:
sum(int([my measure field] = 1)) / count(1)
Be sure to set the default number format for your calculated field to a percentage, by right clicking on it in the data pane (left margin) and revising the default properties
Note, the second calculation works because the INT() function converts True to 1 and False to 0, which is useful in several contexts.
You can go about this using the following method
Add 'measure' to Columns and make it a Discrete Dimension
Add SUM(Number of Records) to Rows. This should give you the bar chart you need.
This would help achieve what you are looking to do. For more customization and a better look for the graph you are looking to build in Tableau.
Add 'measure' to the colour legend and make it a Discrete Dimension.
Add SUM(Number of Records) as a Label and do a '% of Total' quick table calculation.

How to draw time based graphs using ios-charts

I'm trying to draw a temperature graph using iso-charts where the x axis data would be set from a server timestamp but the labels would be readable text.
For instance the graph x-axis label would start at Monday 00:00 and end Tuesday 12pm but the LineChartDataSet would be a collection of temperature (y-axis) and timestamps for the x
To display the timestamp I have a custom valueFormatter set as follow (which works great)
lineChartView.xAxis.valueFormatter = timestampXAxisFormatter() //converts timestamp to Date string
My question: The LineChartDataSet seems to be indexed based which is causing some trouble: if I have 4 data points such as (9am, 10), (9:15am, 11), (12pm, 15), (1pm, 16) the 4 points are set in the chart at regular intervals (I was expecting 2 points to be on the left side of the graph and then last 2 points on the right side) - Is there a way to have a data set that is based on the x value instead of the index?
I saw ChartData has an init that takes an array of NSObjects but then it converts it to Strings...Thanks in advance for any suggestions you may have!
There is no good way to solve it, as you figured out the x axis is index based.
You have two options:
insert many x values between each real x value, like between 9:00 and 9:15, you manually insert 9:01, 9:02, ..., 9:14, but don't add any entry at these values, just ignore it and continue. ios-charts will skip if no entry found and go to next. This will works fine, if you don't have a large number of values to insert. I tried ~1000 values, the performance is acceptable.
you create your own chart, using two y axis, one as x axis and one as y axis, so the distances to 0 point are calculated by value. However this requires you understand the ios-chart logic deeply. If you succeed, you are more than welcome to file a PR.

Core Plot skipped values Graph

i'm trying to draw a Graph with a user-friendly timeline having every day/week (to be decided by time range) as a label at x-axis. However, the datasource values are given on another basis - there might be 10 entries one day and the eleventh comes in a month.
See the photoshop image:
With the latest Core Plot drop I cannot find a way to do it, need your help.
Regards,
user792677.
The scatter plot asks the datasource for x-y pairs of data. There is no requirement that either value follow some sort of sequence or regular pattern. Other plot types work similarly, although the names and number of data fields can vary.
In your example, return 4 from the -numberOfRecordsForPlot: method. Return the following values from the -numberForPlot:field:recordIndex: method. The table assumes your y-values are calculated by a function f(x), but they can of course come from any source. Use the field parameter to determine whether the plot is asking for the x- or y- value.
Index X-Value Y-Value
0 1 f(1)
1 3 f(3)
2 9 f(9)
3 10 f(10)