Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

Friday, November 24, 2017

Chart background graphics: SVG

We are excited to announce SVG background support. This means that chart authors now can use vector or raster graphics for chart backgrounds. The following example shows gender symbols and generation names behind the population pyramid chart:



This chart uses data from this spreadsheet. Import settings are as follows:

Monday, September 11, 2017

SFPD incident database and heatmaps: drug-related incident patterns

San Francisco Police Department provides free access to a great data source:  https://data.sfgov.org/browse?category=Public+Safety. The following couple of charts display drug-related incident distribution by year, weekday, time of day, and district.




Some observations:

  • the notorious "welfare Wednesday" effect is present in early years;
  • incident numbers drop significantly starting 2010, which may be caused by Proposition 215: Wikipedia says "It was not until March 2009 that federal officials announced that they would no longer try to thwart medical marijuana distribution/use in California".
There is a follow-up post focusing on other types of crime in SF using the same data source.

The following are the steps to create the weekday/time heatmap chart using charte.ca editor.

Tuesday, August 8, 2017

Log scale for XY charts

From now on, charte.ca supports log scale in all XY charts (bubble, scatter, motion). Consider the following visualization of World Bank and SIPRI Military Expenditure Database data:




Why log scale? There are a few cases when a log scale is appropriate. The most well known is: log scales allow a large range to be displayed without small values being compressed down into bottom of the graph. Consider the same visualization made using linear scale (this is just a screenshot, not an interactive chart, but it gives you a good idea about the problem):

Monday, July 31, 2017

Motion charts: add categories and animate those bubbles

charte.ca now supports motion charts. Motion charts are basically bubble charts with one more dimension added (usually, it's time). In charte.ca, we use category for this dimension, remember category radio buttons in charte.ca pie charts and bar charts? So, our motion charts are bubble charts with category radio buttons.

Recently, Statistics Canada published a quick overview of interprovincial migration data, using simple line charts. Let's make this data look fancier:



Here are the steps to create this motion chart.

Sunday, May 7, 2017

Comparative histogram charts: population by age group

Great news: charte.ca now supports comparative histograms. This kind of charts comes  handy when you want to compare two or more groups of series side-by-side. In most cases, this type of charts is used to draw a population pyramid, but it has other uses as well.

The following chart shows country population by age group, for multiple years, comparing male and female population.


This post discusses comparative histogram creation process step-by-step.

Sunday, December 18, 2016

Scatter/Bubble charts and regression analysis: median income and obesity levels

Is there a correlation between median income and obesity? I have put some numbers from a few data sources (see full list in the end of the post) in a single GoogleDocs spreadsheet. I have created a new grouped bubble chart and imported the data using CSV/TSV wizard, using Region/Haplogroup column for grouping:

Friday, September 2, 2016

Importing CSV/TSV data: SUM and AVG aggregate functions

These are accountant's favourite aggregate functions. Consider a sample data spreadsheet from Tableau slightly massaged to expose order year, quarter and weekday explicitly - here is the Google spreadsheet we will be working on. About 8000 order lines spanning a few years of an online superstore sales activity.

Quarterly sales by province
Let's create a Line chart with totals for each quarter by province (it happened to be a Canadian superstore).

1. Login to charte.ca and create a new Line chart.

2. In the Data panel, click "Import" (you can find it right under the data grid).

3. On wizard screen #1, paste data from the spreadsheet (we will re-use this data in all examples):


4. On Wizard screen #2, select series (Province), category(Year-Quarter) and value (Sales) columns:


5. On Wizard screen #3 (filtering), leave all fields blank - we do not need any filtering.

6. On wizard screen #4, select SUM aggregate function:


7. On Wizard screen #5 (sorting), leave default values in all fields and click "Done".

8. As a result, you will get this data grid and chart:

Wednesday, August 31, 2016

Importing CSV/TSV data: COUNT aggregate function

Refresh your data journalism skills. Let's look at San Francisco police dept incident database for the years 2003-2013 available here: data.sfgov.org. For convenience, let's use a snapshot of it stored as Google spreadsheet. It contains about 15000 records, one record per incident.

Totals
Let's create a Pie chart with totals for each crime category.

1. Login to charte.ca and create a new Pie chart.

2. In the Data panel, click "Import" (you can find it right under the data grid).

3. On wizard screen #1, paste data from the spreadsheet (we will re-use this data in all examples):


4. On Wizard screen #2, select series (crime category), category(NONE) and value (NONE) columns:


5. On Wizard screen #3 (filtering), leave all fields blank - we do not need any filtering.

6. On wizard screen #4, keep aggregate function selection at COUNT, so data import routine simply counts correspondent records.

7. On Wizard screen #5 (sorting), leave default values in all fields and click "Done"

8. As a result, you will get this data grid and chart:


Totals by year
Naturally, now we are curious how crime picture progressed through the years. Initial steps are the same, but the chart type is Line now.

Monday, August 29, 2016

Importing CSV/TSV data: Tableau example

From now on, charte.ca allows you to import flat comma- or tab-separated data. Usually, CSV/TSV data is just a set of samples that are nor suitable for displaying in a Pie, Bar or Line charts. To overcome this limitation, powerful software packages offer additional functionality like Excel pivot tables. charte.ca allows you to build a pivot table in a few easy steps.

This example shows how you can import data from a Public Tableau visualization. Fortunately, Tableau has a CSV export feature and we will take advantage of it.

1. Login to charte.ca and create a new Regular Line chart.

2. In the Data panel, click "Import" (you can find it right under the data grid).

3. On wizard screen #1, paste data from 



Please note the data we are importing is flat indeed - series, categories and values are just raw data columns. On the next step, we will define the pivot table structure.

4. On Wizard screen #2, select series, category and value columns:


Please keep in mind that in charte.ca editor, series become grid columns, and categories become grid rows. 

5. On Wizard screen #3 (filtering), leave all fields blank - we do not need any filtering.

6. Nothing to select on Wizard screen #4 (aggregate function).

7. On Wizard screen #5 (sorting), leave default values in all fields and click "Done"

8. As a result, you will get this data grid and line chart:

Please note that pivot tables make sense only for Pie, Bar, or Line charts. Scatter or Bubble charts are based on flat data, so there is no need to perform this pivot table magic.

You have probably noticed that this example does not involve any aggregation: every series/category pair in the flat data points to only one value. If this is not the case, and our flat data samples have to be grouped, aggregate function should be used. But this is a good subject for a separate discussion.