Avatar of TUS11
TUS11

asked on 

Google Charts help required, for Demand & Supply chart with extra vertical line

Google charts API help required.

Example link : Click here to see an Example of Chart

Actually, I want to create a demand & supply chart (with Google Charts API) this will be a simple Area chart with to area lines (one for demand & other for supply), but also I want to show a third line (not area only line) see the above link for example.

Any ideas how could I draw such Chart, I could only manage to draw without the Center line part.

Image:
User generated image
Thanks
Web ComponentsJavaScript

Avatar of undefined
Last Comment
TUS11
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Hi,
the type of chart in Google Charts would be a scatter chart, setting the lineWidth and pointSize properties accordingly (using https://code.google.com/apis/ajax/playground/?type=visualization#scatter_chart and adding ", lineWidth: 2, pointSize: 0," after the height property).
The issue is that as far as I know there is no chance to combine an area chart with a scatter chart with Google visualization.

HTH
Rainer
ASKER CERTIFIED SOLUTION
Avatar of TUS11
TUS11

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of TUS11
TUS11

ASKER

You can do that using a ComboChart. The trick is in creating the middle line - normally, you draw lines horizontally, using (x, y) coordinate pairs; to draw vertically, invert the pairs to (y, x), but you must keep them ordered by the x-value (otherwise the line will become messed up).
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo