DATAZAR
Log In
Sign Up



How to Create a Datazar Chart (GUI)

Tags: charts visualizations

In this guide we will go through the steps needed to create a chart. Charts on Datazar provide a GUI (Graphical User Interface) so there is no need to code or program anything.


  • Selecting the Dataset
  • Selecting the Rows
  • Selecting the Columns
  • Rendering and Saving the Chart

Selecting the Dataset

The first thing you need when you want to create a chart is the data. Navigate to any of your datasets. If you don't have a dataset yet, go ahead and upload one or create a new one. The guides for uploading and creating a dataset can be found here and here, respectively.

Once you're on the dataset file page, you'll see a bunch of icons below the dataset preview. The box that contains these icons has the title 'Visualize Your Dataset in Your Browser.' These icons all represent the different charts you can create for your dataset. For this guide, let's pick the 'Area Plot.' It's the first icon in the grid.

When we click it, we'll get redirected to the chart dashboard immediately where we can start pdjusting the parameters. There are a few parameters we can play around with in the chart dashboard, but let's pick two now: the rows we want to visualize and the columns. There are other things we can change, like the theme (we'll use the 'Light' theme here).

The rows selectors help with adjusting what part of the dataset you want to visualize. For example: row 24 to row 131. Doing this will help visualize only the needed parts of the dataset.

alt text

The column selectors allow us to select exactly what columns we want to visualize. You can add and remove any of the columns. You can visualize multiple columns or just a single column. Depeding on the type of chart we're creating, the columns will be divided in axes. For example in this 'Area Plot' chart, we'll have a two axes: the 'X-Axis' and the 'Y-Axis.' In the map charts for example, we'll have the axes 'Latitude' and 'Longitude.'

alt text

Once you have selected the rows and columns, it's time to render the chart. To render the charts, we use the 'Render' button located on the top left corner of the chart dashboard. Right next to it is the 'Save' button that allows us to save the changes to the chart. Once the render shows the chart, go ahead and click on the 'Save' button to make sure all changes are saved. And that's it! You have created your area plot.

alt text

R Plot Function - The Options

R's plot function is probably the most used visualization function in R. It's simple, easy and gets the job done. It's also highly customizable. Adding unnecessary styling and information on a visualization/plot is not really recommended because it can take away from what's being portrayed, but there are times when you have just have to. Whether it's for pure aesthetics, to convey multiple things in one plot, or any other reason, here are the options you can use in R's base plot() function.

The Data Points

We're going to be using the cars dataset that is built in R. To follow along with real code, here's an interactive R Notebook. Feel free to copy it and play around with the code as you read along.

So if we were to simply plot the dataset using just the data as the only parameter, it'd look like this:

plot(dataset)

alt text

Dot Style

The default data points are circles with an empty fill. To change the style of the dots (the data points), we use the option 'pch':

plot(dataset,pch=19)

alt text

The 'pch' accepts several codes, here is a grid with all the different data point styles (the default is 1):

alt text

Data Point Size

To change the size of the data point, we use the 'cex' option:

plot(dataset,pch=19,cex=2)

alt text

Data Point Color

The default color for the data points is black, to change that we use the 'col' option:

plot(dataset,pch=19,cex=2,col="pink")

alt text

The 'col' option takes in both words and integers to identify the color. So you can use words like 'green', 'wheat', 'red' etc... and color codes. To get all the colors, just run colors() and it will return all the colors available. So if you know the location of your favorite color in the return value of the colors() function, you can just run plot(dataset,col=colors()[45]) and you'll have a plot with your favorite color (or just save the color in a variable somewhere in the document if you want to keep re-using it). There are 657 colors in the colors() function.

Axis Labels

If you work in a team, or even if you work alone (but especially if you work with a group), always label your axes. If the dataset you're using has headers or column titles, the plot function will automatically use those as the labels for the plot axes. To add your own, use the xlab() and the ylab() options:

plot(dataset, xlab("Speed (km/h)"), ylab("Distance (km)"))

alt text

Plot Legend

Plot legends can be called using the legend() function. The first two parameters are the x-position and y-position of the legend on the plot. You call this function right after you plot:

plot(dataset,col="blue",pch=4)
legend(20,110,c("Cars"),col="blue",pch=4)

alt text

You want the legend symbol to match the symbol used in the plot. The legend takes in the same pch codes used in the plot() function for the symbols. In addition, you should of course have the same color for the symbols in the legend and the symbols in the plot. Here's some of the options you can play around with in the legend() function:

legend(xPosition: int, yPosition: int, labels: array, col: int|string, cex: int, pch: int)

These are just what I call the essentials, a lot more in the documentation (see below).


And that's it. Like I said before, there are several other options you can use like regression/trend lines, plot sizing etc... These are just the essentials when you want a little something extra on your visualization. In particular stages of the data analysis process, the less you add to your plots, the better.

References and Documentation

Plotting Multiple Columns in D3

From the wide range of things you can do with D3, still one of the best things to make is the timeseries plot. In this post, I'll walk through the basics of making a multi-column point plot/scatter plot. We'll use a GISS dataset from NASA; dataset can be found here.

Setup

Loading the Dataset

First things first, let's load the dataset into the visualization using the dashboard.dataset() function.

var data=dashboard.dataset('f88aa708e-5388-4ed8-8507-ca61c1d6fbf3'); 
//the function uses the file ID to import the dataset content as an object

Loading Libraries (optional)

Now that the dataset in contained in the variable "data", let's setup the libraries we need. In this case we only need one external library, the d3legeneds library. The legend is not an essential part of this project, but it's considered best practice...feel free to skip it. Adding it is easy: just copy a link to a CDN containing that script by clicking on the "Add Library" button. Feel free to use this link:

https://assets.datazar.com/external/d3/d3legends.js

Defining the Columns

Since we're not going to be using all the columns from the dataset, we need to define which columns we're going to be plotting.

var columns=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];

Once we have defined the columns, let's also define what our x-axis is going to be; it's the years in the dataset. And then let's declare what our axes labels are.

var x='Year',y='';
//the variable y is going to be left blank since it's going to change for every month
var xLabel="Year",yLabel="Temperature";
Getting Started With Datazar

Tags: start new general

Hello and welcome to Datazar! We're glad to have you here. This guide will help you get started with Datazar and show you everything you need to get up and running with your first project.


  • Completing Your Profile
  • Creating Your First Project
  • Uploading Your First File
  • Creating Your First Script
  • Using the API
  • Finding People and Projects on Datazar

Completing Your Profile

The first thing you should do when you join Datazar is complete your profile. When you first sign up, you'll get a chance to do that as the on-boarding process will ask you to input a few things about yourself. If you skipped that part, don't worry we all do it, you can always naviagte to your settings and update your information.

The reason it's important to have a full profile is that when you publish your data and/or research, people who consume it have higher confidence in it and you if they know you're a real person.

So having a full profile always boosts people's confidence in your work.

Creating Your First Project

Projects are where all your data, scripts and any other material go when you're working on a particular research project. Let's use an example project. We'll call it 'Project Sigma'. Everything that has anything to do with that research project will go under 'Proect Sigma'.

When you first register, you'll have a default project called 'Getting Started.' This project has a few examples including datasets, r scripts, charts and LaTeX documents. It's your sandbox when you want to experiment as a new user.

Back to 'Project Sigma.' To create a new project, click on the 'New Project' button located in top right corner of any page. This button is available on any page once you're logged in. Clicking on it will prompt a popup with a few fields.

alt text

Enter 'Project Sigma' in the field 'project name' and then enter a project description (it's optional). Lastly, choose if you want to make your project Private or Public. To create a Private project, you must have a Student, Pro or Team account. You're all done, click on the button 'Create Project' and you'll be taken to your newly minted project.

Uploading Your First File

Uploading files is a breeze. First navigate to any of your projects. If you're following from the above section, navigate to the projet we just created-'Project Sigma.' You'll be greeted by the Overview section. In the Overview section, there is a grid of file types you can choose from to create. There is also a button with a plus sign on it and the text 'Upload File.'

alt text

Once you click on it, you'll see a popup. Click on the 'Choose File' button to select a file from your computer. Fill out description field if you want to describe what the file is about (always recommended if you want people/collaborators to understand easily).

alt text

Once you have selected the file, you can optionally change its name on upload by editing the 'name' field next to the 'Choose File' button. If you're done, click on the 'Upload' button. And that's it! The 'Upload' button will appear grayed out and disabled if you haven't selected a file from your computer. Once a file is selected the button will glow green letting you know you're all set for upload.

Creating Your First File

In Datazar, you can upload files and you can also create files directly from your browser. The list of supported files that can be created is always growing so be sure to check the product page for updates.

For this example, let's create an R Notebook. An R Notebook let's you run R commands and get results in realtime all in your browser.

Navigate to any of your projects and you'll land on the Overview section. The overview section contains a grid of file types you can choose from to create.

alt text

For this example let's click on the blue 'R Document' button. This will prompt a popup asking us what type of R Document we want to create. We can choose between 'R Console', 'R Notebook' and 'R Script' but for this guide we'll go with R Notebook.

alt text

As soon as we click on 'R Notebook', we'll be redirected to the notebook interface to start typing R notebooks!

alt text

Using the API

Datazar has a full REST API where you can stream data and send data directly. If you have devices that you want to send data or have applications that consume some data, you can connect them to the Datazar API and have them send data to and from datasets in your projects.

The API inherits the permissions you set from your projects. Private datasets won't be accessible by users who do not have access to them through the Datazar web interface. To view the full documentation of the REST API, head over to docs.datazar.com.

To access the REST API, you'll need an API token. API tokens let you access the API and serve as your password to the API so that you don't have to use your account password. Tokens can be revoked at anytime by the owner (the account that created them). There is no limit to how many tokens you can create.

To create a token, head to the settings page of your account. Tokens are project and file agnostic so you create them from your account settings and not from the project settings. The settings can be found by click on your profile picture in the top right corner of any page. The profile picture will display a dropdown. Click on 'Settings.' Once on the 'Settings' page, navigate to the 'Tokens' section. All you have to do now is click on the 'Create New Token' button. This will display a popup where you have to name the token for reference purposes.

alt text

Once you're done naming the token, click on the 'Create Token' button. And you're done! When you have clicked the 'Create Token' button, you'll be asked to save the token. For security reasons, this will the only time the token will be displayed so go ahead and click on the 'copy' button. This will copy the newly created token to your clipboard so you can paste is somewhere safe.

Finding People and Projects on Datazar

One way to make the most out of your experience with Datazar is to follow different people and collaborate on projects you find interesting. Did you know you can contribute data and help with analyzing datasets on any public projects?

To find people and projects, head over to the Explore Page and filter using keywords that interest you. In the same note, having tags in your profile ensures people with similar interests follow you and contribute to your open projects.


And that's it! We hope this has helped in getting started with Datazar! Don't forget, you can find more guides on docs.datazar.com/guides. If you have any questions, don't hesistate to contact us on support@datazar.com.