I cant update my Magento 2.3.6 Installation. composer update responds with
composer update
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
The requested package magento/product-community-edition ^2.4.0 exists as magento/product-community-edition[2.3.6] but these are rejected by your constraint.
I tried several variants ("2.4.2", "^2.4", "~2.4") of demanding 2.4.2 and every variant had the same result. On which constraint does the Error refer?
This is my composer.json
{
"name": "magento/magento2ce",
"description": "Magento 2 (Open Source)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"require": {
"clever/magento2": "2.4.2",
"magenerds/germanlaw": "1.2.1.1",
"magenerds/language-de_de": "^1.0",
"magento/product-community-edition": "^2.4.0",
"mageplaza/module-core": "^1.4",
"mageworx/module-giftcards": "^2.8",
"payone-gmbh/magento-2": "^2.7",
"trustedshops/trustedshops": "1.0.4",
"php": "~7.3.0||~7.4.0",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-curl": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-hash": "*",
"ext-iconv": "*",
"ext-intl": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-pdo_mysql": "*",
"ext-simplexml": "*",
"ext-soap": "*",
"ext-xsl": "*",
"ext-zip": "*",
"lib-libxml": "*",
"colinmollenhour/cache-backend-file": "~1.4.1",
"colinmollenhour/cache-backend-redis": "~1.10",
"colinmollenhour/credis": "~1.10",
"colinmollenhour/php-redis-session-abstract": "~1.4.0",
"composer/composer": "^1.9 || ^2.0",
"elasticsearch/elasticsearch": "~7.11.0",
"guzzlehttp/guzzle": "^6.3.3",
"laminas/laminas-captcha": "^2.10",
"laminas/laminas-code": "~3.3",
"laminas/laminas-crypt": "~3.3",
"laminas/laminas-db": "^2.12.0",
"laminas/laminas-dependency-plugin": "^2.1.0",
"laminas/laminas-di": "^3.2.0",
"laminas/laminas-eventmanager": "^3.0.0",
"laminas/laminas-feed": "^2.13.0",
"laminas/laminas-filter": "^2.11",
"laminas/laminas-http": "^2.6.0",
"laminas/laminas-i18n": "^2.7.3",
"laminas/laminas-json": "^3.2.0",
"laminas/laminas-mail": "^2.9.0",
"laminas/laminas-mime": "^2.8.0",
"laminas/laminas-modulemanager": "^2.7",
"laminas/laminas-mvc": "^3.2.0",
"laminas/laminas-server": "^2.6.1",
"laminas/laminas-servicemanager": "^3.6.0",
"laminas/laminas-session": "^2.10",
"laminas/laminas-soap": "^2.9.0",
"laminas/laminas-stdlib": "^3.2.1",
"laminas/laminas-text": "^2.6.0",
"laminas/laminas-uri": "^2.5.1",
"laminas/laminas-validator": "^2.6.0",
"laminas/laminas-view": "~2.12.0",
"league/flysystem": "^2.0",
"league/flysystem-aws-s3-v3": "^2.0",
"magento/composer": "1.6.0",
"magento/magento-composer-installer": ">=0.1.11",
"magento/zendframework1": "~1.14.2",
"monolog/monolog": "^1.17",
"paragonie/sodium_compat": "^1.6",
"pelago/emogrifier": "^5.0.0",
"php-amqplib/php-amqplib": "~2.10.0",
"phpseclib/mcrypt_compat": "1.0.8",
"phpseclib/phpseclib": "2.0.*",
"ramsey/uuid": "~3.8.0",
"symfony/console": "~4.4.0",
"symfony/event-dispatcher": "~4.4.0",
"symfony/process": "~4.4.0",
"tedivm/jshrink": "~1.4.0",
"tubalmartin/cssmin": "4.1.1",
"webonyx/graphql-php": "^0.13.8",
"wikimedia/less.php": "^3.0.0",
"web-token/jwt-framework": "^v2.2.7"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"friendsofphp/php-cs-fixer": "~2.18.1",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": "^0.12.77",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "~5.0.0",
"squizlabs/php_codesniffer": "~3.5.4"
},
"suggest": {
"ext-pcntl": "Need for run processes in parallel mode"
},
"replace": {
"magento/module-marketplace": "*",
"magento/module-admin-analytics": "*",
"magento/module-admin-notification": "*",
"magento/module-advanced-pricing-import-export": "*",
"magento/module-amqp": "*",
"magento/module-amqp-store": "*",
"magento/module-analytics": "*",
"magento/module-asynchronous-operations": "*",
"magento/module-authorization": "*",
"magento/module-advanced-search": "*",
"magento/module-backend": "*",
"magento/module-backup": "*",
"magento/module-bundle": "*",
"magento/module-bundle-graph-ql": "*",
"magento/module-bundle-import-export": "*",
"magento/module-cache-invalidate": "*",
"magento/module-captcha": "*",
"magento/module-cardinal-commerce": "*",
"magento/module-catalog": "*",
"magento/module-catalog-customer-graph-ql": "*",
"magento/module-catalog-analytics": "*",
"magento/module-catalog-import-export": "*",
"magento/module-catalog-inventory": "*",
"magento/module-catalog-inventory-graph-ql": "*",
"magento/module-catalog-rule": "*",
"magento/module-catalog-rule-graph-ql": "*",
"magento/module-catalog-rule-configurable": "*",
"magento/module-catalog-search": "*",
"magento/module-catalog-url-rewrite": "*",
"magento/module-catalog-widget": "*",
"magento/module-checkout": "*",
"magento/module-checkout-agreements": "*",
"magento/module-checkout-agreements-graph-ql": "*",
"magento/module-cms": "*",
"magento/module-cms-url-rewrite": "*",
"magento/module-compare-list-graph-ql": "*",
"magento/module-config": "*",
"magento/module-configurable-import-export": "*",
"magento/module-configurable-product": "*",
"magento/module-configurable-product-sales": "*",
"magento/module-contact": "*",
"magento/module-cookie": "*",
"magento/module-cron": "*",
"magento/module-currency-symbol": "*",
"magento/module-customer": "*",
"magento/module-customer-analytics": "*",
"magento/module-customer-downloadable-graph-ql": "*",
"magento/module-customer-import-export": "*",
"magento/module-deploy": "*",
"magento/module-developer": "*",
"magento/module-dhl": "*",
"magento/module-directory": "*",
"magento/module-directory-graph-ql": "*",
"magento/module-downloadable": "*",
"magento/module-downloadable-graph-ql": "*",
"magento/module-downloadable-import-export": "*",
"magento/module-eav": "*",
"magento/module-elasticsearch": "*",
"magento/module-elasticsearch-6": "*",
"magento/module-elasticsearch-7": "*",
"magento/module-email": "*",
"magento/module-encryption-key": "*",
"magento/module-fedex": "*",
"magento/module-gift-message": "*",
"magento/module-gift-message-graph-ql": "*",
"magento/module-google-adwords": "*",
"magento/module-google-analytics": "*",
"magento/module-google-optimizer": "*",
"magento/module-graph-ql": "*",
"magento/module-graph-ql-cache": "*",
"magento/module-catalog-graph-ql": "*",
"magento/module-catalog-cms-graph-ql": "*",
"magento/module-catalog-url-rewrite-graph-ql": "*",
"magento/module-configurable-product-graph-ql": "*",
"magento/module-customer-graph-ql": "*",
"magento/module-eav-graph-ql": "*",
"magento/module-swatches-graph-ql": "*",
"magento/module-tax-graph-ql": "*",
"magento/module-url-rewrite-graph-ql": "*",
"magento/module-cms-url-rewrite-graph-ql": "*",
"magento/module-weee-graph-ql": "*",
"magento/module-cms-graph-ql": "*",
"magento/module-grouped-import-export": "*",
"magento/module-grouped-product": "*",
"magento/module-grouped-catalog-inventory": "*",
"magento/module-grouped-product-graph-ql": "*",
"magento/module-import-export": "*",
"magento/module-indexer": "*",
"magento/module-instant-purchase": "*",
"magento/module-integration": "*",
"magento/module-layered-navigation": "*",
"magento/module-login-as-customer": "*",
"magento/module-login-as-customer-admin-ui": "*",
"magento/module-login-as-customer-api": "*",
"magento/module-login-as-customer-assistance": "*",
"magento/module-login-as-customer-frontend-ui": "*",
"magento/module-login-as-customer-graph-ql": "*",
"magento/module-login-as-customer-log": "*",
"magento/module-login-as-customer-quote": "*",
"magento/module-login-as-customer-page-cache": "*",
"magento/module-login-as-customer-sales": "*",
"magento/module-media-content": "*",
"magento/module-media-content-api": "*",
"magento/module-media-content-catalog": "*",
"magento/module-media-content-cms": "*",
"magento/module-media-gallery": "*",
"magento/module-media-gallery-api": "*",
"magento/module-media-gallery-ui": "*",
"magento/module-media-gallery-ui-api": "*",
"magento/module-media-gallery-integration": "*",
"magento/module-media-gallery-synchronization": "*",
"magento/module-media-gallery-synchronization-api": "*",
"magento/module-media-content-synchronization": "*",
"magento/module-media-content-synchronization-api": "*",
"magento/module-media-content-synchronization-catalog": "*",
"magento/module-media-content-synchronization-cms": "*",
"magento/module-media-gallery-synchronization-metadata": "*",
"magento/module-media-gallery-metadata": "*",
"magento/module-media-gallery-metadata-api": "*",
"magento/module-media-gallery-catalog-ui": "*",
"magento/module-media-gallery-cms-ui": "*",
"magento/module-media-gallery-catalog-integration": "*",
"magento/module-media-gallery-catalog": "*",
"magento/module-media-gallery-renditions": "*",
"magento/module-media-gallery-renditions-api": "*",
"magento/module-media-storage": "*",
"magento/module-message-queue": "*",
"magento/module-msrp": "*",
"magento/module-msrp-configurable-product": "*",
"magento/module-msrp-grouped-product": "*",
"magento/module-multishipping": "*",
"magento/module-mysql-mq": "*",
"magento/module-new-relic-reporting": "*",
"magento/module-newsletter": "*",
"magento/module-newsletter-graph-ql": "*",
"magento/module-offline-payments": "*",
"magento/module-offline-shipping": "*",
"magento/module-page-cache": "*",
"magento/module-payment": "*",
"magento/module-paypal": "*",
"magento/module-paypal-captcha": "*",
"magento/module-paypal-graph-ql": "*",
"magento/module-persistent": "*",
"magento/module-product-alert": "*",
"magento/module-product-video": "*",
"magento/module-quote": "*",
"magento/module-quote-analytics": "*",
"magento/module-quote-bundle-options": "*",
"magento/module-quote-configurable-options": "*",
"magento/module-quote-downloadable-links": "*",
"magento/module-quote-graph-ql": "*",
"magento/module-related-product-graph-ql": "*",
"magento/module-release-notification": "*",
"magento/module-reports": "*",
"magento/module-require-js": "*",
"magento/module-review": "*",
"magento/module-review-graph-ql": "*",
"magento/module-review-analytics": "*",
"magento/module-robots": "*",
"magento/module-rss": "*",
"magento/module-rule": "*",
"magento/module-sales": "*",
"magento/module-sales-analytics": "*",
"magento/module-sales-graph-ql": "*",
"magento/module-sales-inventory": "*",
"magento/module-sales-rule": "*",
"magento/module-sales-sequence": "*",
"magento/module-sample-data": "*",
"magento/module-search": "*",
"magento/module-security": "*",
"magento/module-send-friend": "*",
"magento/module-send-friend-graph-ql": "*",
"magento/module-shipping": "*",
"magento/module-sitemap": "*",
"magento/module-store": "*",
"magento/module-store-graph-ql": "*",
"magento/module-swagger": "*",
"magento/module-swagger-webapi": "*",
"magento/module-swagger-webapi-async": "*",
"magento/module-swatches": "*",
"magento/module-swatches-layered-navigation": "*",
"magento/module-tax": "*",
"magento/module-tax-import-export": "*",
"magento/module-theme": "*",
"magento/module-theme-graph-ql": "*",
"magento/module-translation": "*",
"magento/module-ui": "*",
"magento/module-ups": "*",
"magento/module-url-rewrite": "*",
"magento/module-user": "*",
"magento/module-usps": "*",
"magento/module-variable": "*",
"magento/module-vault": "*",
"magento/module-vault-graph-ql": "*",
"magento/module-version": "*",
"magento/module-webapi": "*",
"magento/module-webapi-async": "*",
"magento/module-webapi-security": "*",
"magento/module-weee": "*",
"magento/module-widget": "*",
"magento/module-wishlist": "*",
"magento/module-wishlist-graph-ql": "*",
"magento/module-wishlist-analytics": "*",
"magento/theme-adminhtml-backend": "*",
"magento/theme-frontend-blank": "*",
"magento/theme-frontend-luma": "*",
"magento/language-de_de": "*",
"magento/language-en_us": "*",
"magento/language-es_es": "*",
"magento/language-fr_fr": "*",
"magento/language-nl_nl": "*",
"magento/language-pt_br": "*",
"magento/language-zh_hans_cn": "*",
"magento/framework": "*",
"magento/framework-amqp": "*",
"magento/framework-bulk": "*",
"magento/framework-message-queue": "*",
"trentrichardson/jquery-timepicker-addon": "1.4.3",
"components/jquery": "1.11.0",
"blueimp/jquery-file-upload": "5.6.14",
"components/jqueryui": "1.10.4",
"twbs/bootstrap": "3.1.0",
"tinymce/tinymce": "3.4.7",
"magento/module-tinymce-3": "*",
"magento/module-csp": "*",
"magento/module-aws-s3": "*",
"magento/module-remote-storage": "*",
"magento/module-jwt-framework-adapter": "*"
},
"conflict": {
"gene/bluefoot": "*"
},
"extra": {
"component_paths": {
"trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
"components/jquery": [
"lib/web/jquery.js",
"lib/web/jquery/jquery.min.js",
"lib/web/jquery/jquery-migrate.js"
],
"blueimp/jquery-file-upload": "lib/web/jquery/fileUploader",
"components/jqueryui": [
"lib/web/jquery/jquery-ui.js"
],
"twbs/bootstrap": [
"lib/web/jquery/jquery.tabs.js"
],
"tinymce/tinymce": "lib/web/tiny_mce_4"
}
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/"
},
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/"
}
},
"prefer-stable": true
}
What is the Problem here?
Upgrade your composer to the latest version and update the specified packages to match your environment
I am trying to sum up values in a csv and populate it using a line chart (Current team strength across months). Now, I am not getting any errors, & neither am getting the chart populated. Can't seem to figure out what is missing.
Here is my code:
<!DOCTYPE html>
<meta charset="utf-8">
<style> /* set the CSS */
body { font: 12px Arial;}
.line {
stroke: blue;
fill:none;
stroke-width: 4;
}
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-size: 10px;
font-family: sans-serif;
}
.text-label {
font-size: 10px;
font-family: sans-serif;
}
</style>
<body>
<!-- load the d3.js library -->
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
// Set the dimensions of the canvas / graph
var margin = {top: 30, right: 20, bottom: 30, left: 50},
width = 600 - margin.left - margin.right,
height = 270 - margin.top - margin.bottom;
// Parse the date / time
var parseDate = d3.time.format("%m/%d/%Y").parse;
// Set the ranges
var x = d3.time.scale().range([0, width]);
var y = d3.scale.linear().range([height, 0]);
// Define the axes
var xAxis = d3.svg.axis().scale(x)
.orient("bottom").ticks(5);
var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5);
d3.csv("Test.csv", function(error, data) {
if (error) throw error;
// Not yet using filtering
var filter = data.filter(function(d){
return (d.Head == 'People' && d.Measure == 'Current Team')
});
var nested = d3.nest()
.key(function(d) {return d.Time_Period;})
.rollup(function(d) {
return {
line1: d3.sum(d, function(e) { return e.Value; })
};
//console.log(line1);
})
.entries(data);
console.log(nested);
x.domain(d3.extent(nested, function(d) { return d.key; }));
y.domain(d3.extent(nested, function(d) { return d.values.line1; }));
// Adds the svg canvas
var svg = d3.select("body").append("svg");
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
svg.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("Price ($)");
var line_1 = d3.svg.line()
.x(function(d) { console.log(parseDate(d.key));return parseDate(d.key); })
.y(function(d) { console.log(d.values.line1);return d.values.line1; });
console.log(line_1.x.value);
svg.append("path")
.datum(nested)
.attr("class", "line")
.attr("d", line_1)
.style("stroke", "steelblue")
.attr("fill", "none")
.attr("stroke-width", 4.8)
.attr("stroke-opacity", 0.0001)
.transition().duration(2000)
.attr("stroke-opacity", 1)
.attr("stroke-width", 2.8);
});
</script>
<Test.csv>
[
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
},
{
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}
]
I made following updates in your code and it seems to be working fine in the snippet.
Position and size of SVG container.
Parsing of x axis date values.
The values in your question was showing a straight line. I have used some random values for a different look.
var data = [{
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "75",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "18",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Cunt"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "15",
"Measure": "Planned Team",
"Time_Period": "4/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "5/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "6/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Current Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "6",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "5",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "New Joinees",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "10",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "IN",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "20",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Reporting & Vizualization",
"Value": "30",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}, {
"RU": "US",
"Head": "People",
"Industry": "-",
"Practice": "Data Integration",
"Value": "0",
"Measure": "Planned Team",
"Time_Period": "7/1/2016",
"Unit": "Count"
}];
var margin = {
top: 30,
right: 20,
bottom: 30,
left: 50
},
width = 600 - margin.left - margin.right,
height = 270 - margin.top - margin.bottom;
// Parse the date / time
var parseDate = d3.time.format("%m/%d/%Y").parse;
// Set the ranges
var x = d3.time.scale().range([0, width]);
var y = d3.scale.linear().range([height, 0]);
// Define the axes
var xAxis = d3.svg.axis().scale(x)
.orient("bottom").ticks(5);
var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5);
// Not yet using filtering
var filter = data.filter(function(d) {
return (d.Head == 'People' && d.Measure == 'Current Team')
});
var nested = d3.nest().key(function(d) {
return d.Time_Period;
})
.rollup(function(d) {
return d3.sum(d, function(e) {
return +e.Value;
})
//console.log(line1);
})
.entries(data);
x.domain(d3.extent(nested, function(d) {
return parseDate(d.key);
}));
y.domain(d3.extent(nested, function(d) {
return d.values;
}));
// Adds the svg canvas
var svg = d3.select("body").append("svg").attr("height", height + margin.top + margin.bottom)
.attr("width", width + margin.left + margin.right)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
svg.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("Price ($)");
var line_1 = d3.svg.line()
.x(function(d) {
return x(parseDate(d.key));
})
.y(function(d) {
return d.values;
});
//console.log(line_1.x.value);
svg.append("path")
.datum(nested)
.attr("class", "line")
.attr("d", line_1)
.style("stroke", "steelblue")
.attr("fill", "none")
.attr("stroke-width", 4.8)
.attr("stroke-opacity", 0.0001)
.transition().duration(2000)
.attr("stroke-opacity", 1)
.attr("stroke-width", 2.8);
.line {
stroke: blue;
fill: none;
stroke-width: 4;
}
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-size: 10px;
font-family: sans-serif;
}
.text-label {
font-size: 10px;
font-family: sans-serif;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>