Google Charts API - Dual Y-axis Line Chart

Developer
Size
2,089 Kb
Views
76,912

How do I make an google charts api - dual y-axis line chart?

What is a google charts api - dual y-axis line chart? How do you make a google charts api - dual y-axis line chart? This script and codes were developed by NM on 22 October 2022, Saturday.

Google Charts API - Dual Y-axis Line Chart Previews

Google Charts API - Dual Y-axis Line Chart - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Google Charts API - Dual Y-axis Line Chart</title>
</head>
<body> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div> <script src="js/index.js"></script>
</body>
</html>

Google Charts API - Dual Y-axis Line Chart - Script Codes JS Codes

 google.charts.load('current', {'packages':['line', 'corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var chartDiv = document.getElementById('chart_div'); var data = new google.visualization.DataTable(); data.addColumn('date', 'Month'); data.addColumn('number', "Average Temperature"); data.addColumn('number', "Average Hours of Daylight"); data.addRows([ [new Date(2014, 0), -.5, 5.7], [new Date(2014, 1), .4, 8.7], [new Date(2014, 2), .5, 12], [new Date(2014, 3), 2.9, 15.3], [new Date(2014, 4), 6.3, 18.6], [new Date(2014, 5), 9, 20.9], [new Date(2014, 6), 10.6, 19.8], [new Date(2014, 7), 10.3, 16.6], [new Date(2014, 8), 7.4, 13.3], [new Date(2014, 9), 4.4, 9.9], [new Date(2014, 10), 1.1, 6.6], [new Date(2014, 11), -.2, 4.5] ]); var classicOptions = { title: 'Average Temperatures and Daylight in Iceland Throughout the Year', width: 900, height: 500, curveType: 'function', // Gives each series an axis that matches the vAxes number below. series: { 0: {targetAxisIndex: 0}, 1: {targetAxisIndex: 1} }, vAxes: { // Adds titles to each axis. 0: {title: 'Workers per dependent (solid line)'}, 1: {title: 'Inclome per person (dotted line)'} }, hAxis: { gridlines: { color: 'white' } }, vAxis: { viewWindow: { max: 30 }, gridlines: { color: 'transparent' } }, }; function drawClassicChart() { var classicChart = new google.visualization.LineChart(chartDiv); classicChart.draw(data, classicOptions); } drawClassicChart(); }
Google Charts API - Dual Y-axis Line Chart - Script Codes
Google Charts API - Dual Y-axis Line Chart - Script Codes
Home Page Home
Developer NM
Username tokant
Uploaded October 22, 2022
Rating 3
Size 2,089 Kb
Views 76,912
Do you need developer help for Google Charts API - Dual Y-axis Line Chart?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

NM (tokant) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!