score:2
@etienne was able to point me in the right direction with this Pen (https://codepen.io/etpinard/pen/VrzwyP)
JS:
var years = ['2014', '2015', '2016']
Plotly.d3.csv('https://raw.githubusercontent.com/apodagrosi/datasets/master/PlotlyTest_Summary_SalesByDealerByYear.csv', (err, rows) => {
var data = years.map(y => {
var d = rows.filter(r => r.year === y)
return {
type: 'bar',
name: y,
x: d.map(r => r.dealer),
y: d.map(r => r.sales)
}
})
Plotly.newPlot('graph', data)
})
HTML:
<head>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="graph"></div>
</body>
I also utilized 'category order' to order the x-axis values that did not have sales (y-axis) values.
Source: stackoverflow.com
Related Query
- Plotly/D3 – Reading data from CSV into separate traces
- Copy data from csv into array in D3
- display data from csv file into BarGraph using d3.js
- reading d3 data in from a file rather than hard coding it into a programme
- ScatterChart in NVD3 – Reading the data from csv file
- Django D3 reading csv data from mongodb to plot graph
- D3.js reading Lat Long coordinates from csv into Google Map
- Extracting data from excel sheet into csv (or) Json using Javascript
- using variable to parse data with D3js when reading in from csv file
- Reading two separate headers from the same csv file (d3)
- How to load data from a CSV file in D3 v5
- Importing data from multiple csv files in D3
- d3 - reading JSON data instead of CSV file
- Cannot import data from csv file in d3
- Select data from a CSV before loading it with javascript (d3 library)
- D3.js Plotting Multiple Data Sets from Separate Files
- Dynamically loading external data from database into d3.js
- Creating a D3.js Collapsible Tree from CSV data
- Read csv data with D3.csv, each column in separate array
- How to update elements of an HTML that the elements are created using data from a CSV file?
- Bringing data from PHP into D3.JS
- Javascript d3 reading from csv
- Separate data from datahash
- Display only values from the data set into X axis ticks
- Best Practices for reading csv data with d3 in node. Why gettting a TypeError?
- Merging arrays that hold CSV data into one object array
- reading nodes and edges from two distinct csv files using Force Layout
- D3.js - building a force directed hierachical tree from csv data
- Rendering D3 data from CSV
- how to get data with tsv or csv to array in d3.js from a txt file?
More Query from same tag
- d3.js Line Chart -- Need to load an arbitrary number of data series
- Svg width not display de leftscale in d3.js heatmap /
- dataset created with d3.nest isn't drawing correctly
- d3.js trying to call data method twice on same selector produces strange results
- D3 add zoom and pan
- Converting an array to an object of nested objects for a tree diagram in Javascript
- D3 - Binding each data category to g
- d3 click event is stopped with zoom and pan layer
- D3.js - Use newline character in rendered text
- D3: position tooltip outside Donut Chart
- Filter d3.s to show specific data
- Stuck with integrating d3 with data
- D3: Append duplicates of a selection
- jQuery .text() is working but not .html()
- clicking a node in d3 from a button outside the svg
- How is the distance between the nodes / length of the link between the nodes defined in a forceSimulation d3?
- D3 charts : How to open a radar ticket by clicking on the graph.?
- nvd3.js : unable to bind onClick event with the data points in the svg
- D3--How to iterate through an array of colors
- Assigning two class names from functions in D3
- transitioning rotated axis labels with D3
- How to add using d3.js selection.text() method
- x axis rescale using dropdown in line chart d3
- Looping through array of objects within multiple objects and accessing values in D3 using underscore
- Error reading JSON file in Bundle layout in D3.js
- How to assign a specific id to each line in a multi-line chart with multiple y-axes
- How to call ajax by clicking d3.js graph
- D3 Bar Chart Values Out of Scale Range
- d3 zoom pan to specific region of line graph
- How can one draw thumbnails as children in D3 Zoomable Icicle Layout?