Column Chart Non-consecutive y-axis

13 views
Skip to first unread message

Aharon K

unread,
Sep 22, 2020, 8:05:55 PM9/22/20
to Google Visualization API
Hello All,
I created a Column Chart using JavaScript, basically just copying the code on the site and switching out the sample data for my data, but when I run it, I see the numbers on the y-axis are non-consecutive, and seem to be based on my data rather than going from 0 to n. Can anybody shed some light on why this is occuring?

Here is what I switched for the sample drawChart():
```
function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Word Length', 'A Tale of Two Cities', 'Great Expectations', 'Hamlet', 'Macbeth'],
['1', '3.5929999999999995', '5.6930000000000005', '3.8890000000000002', '3.755'],
['2', '18.126', '19.158', '17.568', '14.969'],
['3', '24.148', '23.656', '21.343999999999998', '21.637999999999998'],
['4', '18.378', '19.203', '22.218', '21.396'],
['5', '10.729', '9.879', '12.092', '15.081'],
['6', '7.924', '6.888', '8.624', '9.647'],
['7', '6.482', '6.087', '6.433', '6.343'],
['8', '4.453', '3.698', '3.499', '3.563'],
['9', '2.749', '2.429', '2.003', '1.7590000000000001'],
['10', '1.595', '1.496', '1.078', '0.942'],
['11', '0.8659999999999999', '0.8540000000000001', '0.707', '0.468'],
['12', '0.504', '0.496', '0.409', '0.203'],
['13', '0.258', '0.27399999999999997', '0.094', '0.096'],
['14', '0.095', '0.098', '0.022000000000000002', '0.017'],
['15', '0.047', '0.047', '0.009000000000000001', '0.006'],
['16', '0.018000000000000002', '0.016', '0', '0.011000000000000001'],
['17', '0.006', '0.01', '0', '0'],
['18', '0.006999999999999999', '0.008', '0.006', '0'],
['19', '0.002', '0.006', '0', '0'],
['20', '0.001', '0.001', '0', '0'],
['21', '0', '0.002', '0', '0'],
['22', '0.001', '0.001', '0', '0'],
['23', '0', '0.001', '0', '0'],
['27', '0', '0.001', '0', '0'],
['33', '0', '0', '0.003', '0']
        ]);
```

Thank you

Aharon Katz

unread,
Sep 22, 2020, 8:09:19 PM9/22/20
to google-visua...@googlegroups.com
This is the graph I get:
image.png
image.png

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/7hgbCFuubH8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/9678c384-f527-486c-8171-1a401a675c11n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages