Sunday, May 31, 2015

Chart Types and Data Models in Google Charts

Different data model is need for different chart types. This post is basically covering google chart types and support of data models.

Bar charts and Column chart
Each bar of the chat represent the value of elements of x-axis. Bar charts display tooltips when the user hovers over the data. For a vertical version of this chart called the 'column chart'.
Each row in the table represents a group of bars.
  • Column 0 : Y-axis group labels (string, number, date, datetime)
  • Column 1 : Bar 1 values in this group (number)
  • Column n : Bar N values in this group (number)



Area chart
An area chart or area graph displays graphically quantities data. It is based on the line chart. The area between axis and line are commonly emphasized with colors, textures and hatchings.
Each row in the table represents a set of data points with the same x-axis location.
  • Column 0 : Y-axis group labels (string, number, date, datetime)
  • Column 1 : Line 1 values (number)
  • Column n : Line n values (number)


Scatter charts
Scatter charts plot points on a graph. When the user hovers over the points, tooltips are displayed with more information.



Each row in the table represents a set of data points with the same x-axis value.
  • Column 0 : Data point X values (number, date, datetime)
  • Column 1 : Series 1 Y values (number)
  • Column n : Series n Y values (number)
(This is only fake sample data for chart representing)


Bubble chart
A bubble chart is used to visualize a data set with two to four dimensions. The first two dimensions are visualized as coordinates, the third as color and the fourth as size.
  • Column 0 : Name of the bubble (string)
  • Column 1 : X coordinate (number)
  • Column 2 : Y coordinate (number)
  • Column 3 : It is optional. A value representing a color on a gradient scale  (string, number)
  • Column 4 : It is optional. A Size - values in this column (number)


Bubble Name is  "January"
X =  22
Y =  12
Color = 15
Size  = 14


Summary Of the Data model and Axis in chart types.

The major axis is the axis along the natural orientation of the chart. For line, area, column, combo, stepped area and candlestick charts, this is the horizontal axis. For a bar chart it is the vertical one. Scatter and pie charts don't have a major axis. The minor axis is the other axis.
The major axis of a chart can be either discrete or continuous. When using a discrete axis, the data points of each series are evenly spaced across the axis, according to their row index. When using a continuous axis, the data points are positioned according to their domain value. The labeling is also different. In a discrete axis, the names of the categories. In a continuous axis, the labels are auto-generated.
Axes are always continuous
  • Scatter
  • Bubble charts
Axes are always discrete
  • The major axis of stepped area charts (and combo charts containing such series).

In line, area, bar, column and candlestick charts (and combo charts containing only such series), you can control the type of the major axis:

  • For a discrete axis, set the data column type to string.
  • For a continuous axis, set the data column type to one of: number, date, datetime.

No comments:

Post a Comment