Forum Replies Created
10 months, 2 weeks ago david blackwellParticipant
Pamela, et al.
Thank you for the kind words. Regarding the x-axis, I had a problem to overcome. I use a water-year construct for segregating the datasets. This created issues for me in both Microsoft Excel (where I post-process much of my data) and DataGraph. My water-year begins on the 1st day of the 10th month of a traditional year and ends on the 30th day of the 9th month. Sorting and segregating daily data using date fields was a challenge.
In essence, I assigned each row (daily) of data a new index called the Day of Wateryear (DWY). October 1 was DWY 01; September 30th of the following year was DWY 365 (0r 366 in leap years). DWY was the first data column imported into DataGraph. It was formatted as a number field.
I also created a new yearly index called a water-year in the form of yyyy-yz in my spreadsheet. In Datagraph, these water-years form the column names containing the annual dataset for each water-year respectively (e. 1948-49, 1949-50, etc.)
So the x-axis is plotted to the DWY field (a number). Specified tick marks were added on the last DWY of each month. Text labels were added as aides to viewers to help them find their way along the x-axis.
I crafted a quick web page with screen shots and more detail. As mentioned, it was quickly pulled together; there are likely errors on that page. More detail to follow on that web page in the coming days:
Thanks again for the feedback. It’s very much appreciated.
1 year ago david blackwellParticipant
- This reply was modified 10 months, 2 weeks ago by david blackwell.
I was actually able to answer this on my own. The short answer is to create a time or a number variable in the form of a date (e.g. yyyy:mm:dd). Then, create two instances of the variable in a label or text field, formatting the first, using the example in my question, as:”d Mon”. And using the second variable formatted as “yyyy”.
This was probably a simple and obvious answer for many, but I had a little mental block on it. It finally occurred to me after my second cup of coffee this morning. It is probably why the Datagraph team formatted dates the way they did – to offer the user a lot of flexibility.
Here’s a screen shot of it in action. I formatted my dates a little differently in this example than I did in my first question to the forum:
in reply to: Adding new formats for date variables?1 year, 6 months ago david blackwellParticipant
- This reply was modified 1 year ago by david blackwell. Reason: Corrected typos. Added hashes to tags
I’m able to publish approximately 1500 COVID-related charts per week using a combination of Text Menu variables (for state and country lists), masked columns (to find median and mean variables for the most recent date), and Redirect columns (for selecting various y-axis variables using a single chart).
It takes a little time to learn, but is relatively easy. There are several tips on this site to help you get there. I used this forum myself to get help. I’ll have to learn some of the techniques the moderator suggests to further automate my charts for publishing.
Basically I publish charts for 50 U.S. states and the District of Columbia. I also publish charts for 50 peer countries.
My data variables include: daily test counts; daily cases counts; daily mortality rates; daily vaccination rates; etc.
It would be prohibitively time-consuming to publish this many charts individually. This is the great thing about Datagraph. I timed myself once to see how long it took to produce the 1500 charts. It took about 90 minutes, and I believe more than half of that time was in prepping the data downloads prior to importing them into Datagraph. I susepct if I was smarter about automating the download of data, I could greatly reduce this chart preparation time.
A sample of one of these published chart sets is shown here. There are more links to similar charts in the left-hand navigation menu list:
I hope this helps. All the best.in reply to: How to adjust multiple graphs at the same time
By the way, pardon the typos in my previous reply and I noticed the chart values in the image I sent do not quite correspond the the y-axis. This is what I meant by going back to “clean things up”.
Nevertheless, the method you provided to find a median for select days in my column works very well and is easy to implement.
Your masked column method works like a charm! I performed a quick trial based on your answer to test this and need to go back a clean it up a little, but it will work for multiple charts I publish. It saves me the trouble of processing the median for select days in Excel, which is not bad but is extraneous and more subject to error.
Thank you so much!
BTW – I also use an variable for the data’s most recent update day. ?I can use this variable within the masked column definition to avoid need to update the new Median variable each time I publish.
I publish upwards of 600-700 charts almost daily (including a chart for each state or district for many variables). This and other tricks the Forum has given me has enabled me to publish this data relatively quickly each day.
Here is an image of the resultant chart. The median value is represented by the dashed black line. The median numerical value is also given in the legend.
Thanks again for the quick reply…
A clarification to my question:
“I imagine it has to do with using a range of row index number as a mask, or using the most recent data as a mask…” should read:
“..or using the most recent date…”1 year, 9 months ago david blackwellParticipant
I think you might be talking about a Cleveland dot plot. If so, I make these all of the time and it is quite easy.
Step 1. Create a scatterplot. Use the # column as the y-values.
Step 2. Change the “Y tick marks” field to ‘Categories’.
Step 3. Change Labels for the “Y tick marks” to the text field you wish to plot.
Here is a sample dot plot made with Datagraph.
Here is what the annotated dgraph application screen looks like to accomplish this.
I hope this helps…
Seattlein reply to: Plot/Points with Text as one column1 year, 10 months ago david blackwellParticipant
One more thing. Here is a link to a 51-chart sample page I published with some basic stats on published file sizes and upload times using the methods described above.in reply to: Column Name variable1 year, 10 months ago david blackwellParticipant
A Datagraph moderator named David gave me the correct solution to my question. It is quite easy to set up and implement. He gave good directions, but I’ll elaborate here with screen shots of my own datagraph file.
Setting the Table
I download COVID data for all 50 U.S. states and the District of Columbia from John Hopkins University in the form of a large .csv file. I import this file into my master COVID Datagraph file directly and as-is.
I have a minimum of six (6) sets of state-level data I like to develop charts for and publish. These include:
- Cumulative COVID Testing by State
- Daily COVID Testing by State
- Cumulative COVID Cases by State
- Daily COVID Cases by State
- Cumulative Positivity by State
- Daily Positivity by State
In the past, the way I had my Datagraph file set up meant I had (306) charts to update and publish. I found ways to minimize this to updating six sets of charts most days through the use of title, text and axis variables.
However, if there was a change in the data structure (e.g. the underlying .csv file) or to the design of a chart, I was required to update multiple elements in all (51) charts for each set of data. Both happened frequently, especially early on in this data project. It was very tedious to update these with the way I originally set up my datagraph file.
1. The y-column Variable Solution
An administrator from Datagraph named David really simplified my process by offering two key bits of advice.
The first was to create a “Redirect” column. This is located in the top menu bar of the Column Definitions menu under the “Other” drop-down menu. Selecting this, you see there is a Redirect-type column (A). It appears in the list of column definitions below (B). You also see it in the table of data (C).
In the column definition section, you can select which column to redirect data from (B1). This is how you can set up a ‘master’ chart and with a y-value variable.
2. Publishing Graphics via a Loop Mechanism
The second piece of advice David gave me was equally useful, maybe even a little more. My former Datagraph file contained a separate chart for each state. Now I can publish a unique graphic for each state from a single master chart.
The first step is to build a text variable menu (D). After typing in the first two-letter state postal code abbreviation for Alaska (AK), you have the option to populate the remaining names by clicking on the gear wheel of this new variable and selecting “Add unique values (the column) state”.
Steps E1 and E2 shown in the graphic set up the variable masks for the red state data line and the state red text element in the chart.
Once D, E1 and E2 are finished, Step F shows how to publish all 51 charts in a single click.
I hope this helps.
David B.in reply to: Column Name variable