Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chart API - Stepped Line Chart

I'm trying to get a stepped line chart with Google Chart API. I've searched the docs and haven't found anything.

Here's an example I saw with Flot:

http://www.flotcharts.org/flot/examples/threshold/index.html

More info:

I'm trying to plot account balances over time. So, if there's a balance of $1,000 on Jan 1 and a balance of $2,000 on Feb 1, the google line chart displays a sloped line between Jan and Feb, which does not reflect the actual account balance accurately. I'd rather not plot more values (i.e. by adding the balance of $1,000 on Jan 31) but may have to if that's the only way...

like image 918
alex Avatar asked Feb 20 '13 23:02

alex


People also ask

What is a stepped line graph?

A stepped line graph (also called step chart) is a chart similar to a line graph, but with the line forming a series of steps between data points. A stepped line chart can be useful when you want to show the changes that occur at irregular intervals.

What is a step by step chart called?

A flowchart is a diagram that shows each step or progression of a process in sequential order. Lines indicate directional flow and there's a standard set of symbols that help describe the step-by-step procedures, inputs, and decisions in the process.


2 Answers

In your example, if you plot the $1,000 on Feb 1 (ie the before and after values on the same date) you get a nice step. It's a work-around and there must be better solutions, but it's easy to implement and does give you what you're after visually.

like image 196
Piddles Avatar answered Oct 04 '22 23:10

Piddles


Look into the following article: https://developers.google.com/chart/interactive/docs/gallery/steppedareachart?hl=ru
and playground:
https://code.google.com/apis/ajax/playground/?type=visualization#stepped_area_chart

like image 38
Pavel Slepiankou Avatar answered Oct 04 '22 21:10

Pavel Slepiankou