how to handle series data when you can't predict data set? - highcharts

I'd like to create a highchart line chart with drill down to addition data.
The first data point would be date and total count, i.e., (2019-04-01, 3,000)- I have that part down and displaying.
The drilldown would be a break down of the total, such as:
Cats 1,000
Dogs 1,000
Pigs 1,000
I can do that too, but only when I can predict the drilldown series. The data set is dynamic, it could, for example, sometimes include birds and fish, or not have pigs.
I've create a pie chart with drilldown and set an array to have the drilldown data... I could pull this off because the data was predictable. I'm using PHP to create the data set but could use python or csv is that makes it feasible.
The drilldown should be dynamic and be able to handle any introduced series.

Related

How to create column and lines charts from this simple spreadsheet?

I'm trying to create two charts from a local cycling club's account spreadsheet. These will provide "at-a-glance" overviews of the state of the current finances.
The spreadsheet has a columns with incoming monies (receipts) and the date received, with similar columns for outgoing money (payments).
The first chart will sum up the incoming outgoing columns and display these in a simple column chart. A quick glance should show that the incoming column is taller than the outgoing (hopefully!). This is where I hit my first problem - I don't seem to be able to use SUM in the chart:
I have ended up having to reference a cell containing the sum of the column, but this sum takes into account a cell (C3) which contains balance brought forward from a previous year which I want to ignore for this chart:
The other chart I want is a line chart showing amount of money on the y-axis and time on the x-axis. The receipts line should go up over the year (again, hopefully) and the payments should go down. I'm not even close to getting this correct:
It should be something like this, so as the year passes (x-axis) the amount (y-axis) of receipts and payments increases:
How can I create these charts?
Spreadsheet is here - https://docs.google.com/spreadsheets/d/1-8DzB6c3rZ8evfNJ8iRcO_2BletbH81FV4hIis0-Fj4/edit?usp=sharing
I tried to replicate your graph and found some issues:
On the first graph, you cannot use formula in Data Range. The input should only be a A1 notation. Creating another entry on B16:C17 and use it as graph data is correct.
If you want to ignore C3, just change the formula in your C16 with =SUM(C4:C8)
Based on the sketch you've provided for the second graph, The data will only go up by getting running total or cumulative sum of each data per category (Receipts, Payments). Unfortunately, Google Sheet does not have built it function that can automatically do that. You have to create another column for cumulative sum.
Example:
For Receipts, insert this in D4:
=ArrayFormula(If(len(C4:C8),(SUMIF(ROW(C4:C8),"<="&ROW(C4:C8),C4:C8)),))
It will create another column with cumulative sum of C4:C8.
For Payments, insert this in H3:
=ArrayFormula(If(len(G3:G7),(SUMIF(ROW(G3:G7),"<="&ROW(G3:G7),G3:G7)),))
The dates from Receipts and Payments are different, if you only use the dates of Receipt, the data for Payments will be inaccurate. You need to create another table that will combine the dates and data of those two categories.
Try this:
J2: ={A4:A8;E3:E8}
K2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, A4:D8, 4, false)))
L2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, E3:H7, 4, false)))
Make sure to add Labels on K1 and L1.
It should look like this:
Once you have the data, just highlight J1:L11 and Go to Insert -> Chart -> Convert it to Smooth line chart -> Check Aggregate
The graph should look like this:
References:
VLOOKUP
ARRAYFORMULA

How could I get values of indicators used in a chart in MetaTrader 4?

I need to get the opened indicators values (a bunch of this) from a current chart of MetaTrader 4 (by using mql4), and export this values on python (by using ZeroMQ library), in order to create a dictionary of this values and using it for other purpose. I just do that for candlestick data, but that's quite simple. I know there's ChartIndicatorTotal to know number of total indicators on the chart, and ChartIndicatorName to know the names of the indicators on the chart, but I don't know how I should use this functions in order to get the values I want.

timeline chart not drawing "null" data

when I use the data below in a google sheets timeline chart it doesn't plot 29/04/2019 5% and 10% leaving a gap in a chart, how can I resolve this? the chart should be unaffected by empty fields.
Date 5% Target 10% Target Actual
22/04/2019 120.6 120.6 120.6
29/04/2019 119.5
22/07/2019 114.57 108.54
22/10/2019 108.84 97.69
22/01/2020 103.40 87.92
22/04/2020 98.23 79.13
22/07/2020 93.32 71.21
22/10/2020 88.65 64.09
22/01/2021 84.22 57.68
22/04/2021 80.01 51.91
22/07/2021 76.01 46.72
22/10/2021 72.21 42.05
22/01/2022 68.60 37.85
22/04/2022 65.17 34.06
22/07/2022 61.91 30.65
22/10/2022 58.81 27.59
22/01/2023 55.87 24.83
22/04/2023 53.08 22.35
22/07/2023 50.43 20.11
I have tried adding another dataset and I get the error
each values column may be followed by one or two annotation columns. column number 4 is of type date
Here is a link to the spreadsheet
There are gaps in your data, so you're going to have gaps in your chart. That's just how Timeline Chart works. There are ways of having charts skip gaps, but you have the 29th as a date, so it is explicitly part of your timeline.
The least burdensome remedy is usually to chart a different dataset living elsewhere, filtered down live from your input values, but meeting your charting requirements. E.g. elsewhere in your file have it list only the rows where 5% Target is populated with something like =FILTER(B2:E,LEN(C2:C)) and then chart that.
If that's not what you really want, then you need to decide what you really want. A time-cropped chart to only include fully-populated date ranges? A chart with made-up values extrapolated from surrounding data? Those and some other options are not trivial, so you'll need to really determine your requirements and look into how they can be achieved.

Spreadsheet importrange high/low during specific times

I want to use importrange to pull in just the high/low data during a specific time of the day, ignoring the rest of the days update. Specifically from 8:30am to 2:50pm weekdays only.
=importhtml("http://www.marketwatch.com/investing/stock/aapl"&"?"&"workaround="&INT(NOW()),"table")
So for example, I only want to pull in the specific data starting at 8:30am and ending at 2:50pm
The =importhtml() function doesn't have the have the ability to filter data. The query parameter is for:
query - Either "list" or "table" depending on what type of structure contains the desired data.
You can import the data, then run a =query() on the imported data, using the range that the imported data is displayed in.
That URL only has one table in it, and it's not the data for the aapl stock chart. There are 8 lists in that web page, but none of them are for the data in the aapl stock. You aren't going to be able to scrape that chart with =importurl()
The chart is in a <canvas> tag.

Representing sparse data in a Highcharts series

I'm trying to generate a stacked column chart. What I want is similar to this JSfiddle example. However, I have around 30 categories and 1000 series. The series are rather sparse. There are only about 200 values. But because highcharts needs each series to have values across the x-axis categories, I'm forced to submit 1000 series each having 30 values (mostly zeroes). The chart takes over a minute to render. How can I improve this performance?
There is another way you can pass the data to highcharts, where you specify x and y for each point. This means you can skip the 0 values. In the fiddle you quoted, I modified one line to be:
data: [{x:1,y:5}, {x:3,y:7}],
http://jsfiddle.net/rh9aK/
I expect that 1000 series and 30 categories may still be too much, but this is worth a try.
One other thing, have you made sure that you don't have any series which only contain zeros ? If so, you may as well remove them before rendering.
JS charts, in you case, will produce too many DOM elements. It will be too complex for browser. You need some server-side solution which generate graps inside image.

Resources