nvd3.js

custom no data label in nvd3 scatter chart

时光怂恿深爱的人放手 提交于 2019-12-22 02:21:13
问题 I am trying to have custom message instead of the "No Data Available" message which is displayed. I am using nvd3 scatter / bubble chart. I came across a suggestion here data2 = [ { "key" : "A key" , "values" : [[]] } ]; but I want to change the message. I looked at the source scatter.js but did not find "No Data Available" message. Do I need to modify another source file? How can I do so? 回答1: Looking at the source, it seems that you can set the message using .noData() : chart.noData(

Replace d3.js symbols with images

坚强是说给别人听的谎言 提交于 2019-12-21 21:29:18
问题 Referring to this fiddle example : I need to replace the symbols with images...or possibly a single image at first..like for instance, this image: https://github.com/favicon.ico What I am trying in the code is as follows: vis.selectAll("path") .data(nodes) .enter().append("path") .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .append("image") .attr("xlink:href", "https://github.com/favicon.ico") .attr("x", -8) .attr("y", -8) .attr("width", 16) .attr("height",

Responsive pie chart using NVD3

半腔热情 提交于 2019-12-21 16:18:13
问题 I'm working on a simple example of a pie chart using NVD3. It renders correctly but it is not responsive. I tried to follow this answer to make it responsive, but didn't quite get to it. I made a fiddle. Indeed, it is responsive, but I'm not able to fit the chart in the container. My js code: nv.addGraph(function() { var chart = nv.models.pieChart() .x(function(d) { return d.label }) .y(function(d) { return d.value }) .showLabels(true); var $container = $('#chart'), width = $container.width()

how to set the domain and scale on an axis on a nvd3.js multiBarChart

倾然丶 夕夏残阳落幕 提交于 2019-12-21 03:41:06
问题 In d3.js you can set an x axis to use d3.time.scale() then set x.domain([start_date, end_date]) and it will 'fill in' any missing dates that aren't in the data with 0 values. I want to do the same with a nvd3.js mulitBarChart . This code (can be pasted directly into http://nvd3.org/livecode/#codemirrorNav) shows a bar chart of totals by year, there are missing values for 2002 & 2003. I want to set the scale to be d3.time.scale() and then the domain to the first and last years of the dataset

How to avoid memory leaks using angularjs-nvd3-directives

柔情痞子 提交于 2019-12-20 10:36:34
问题 I'm working on an angularjs application using angularjs-nvd3-directives to render charts. After a check with Chrome Developer Tools, I detected some memory leaks linked to the charts. When the user navigates through different views containing charts the memory is never fully released. I'm already doing some cleanup on the graphs controllers: $scope.$on('$destroy', function() { d3.select( '#exampleId' ).remove(); d3.select( '#exampleId2' ).remove(); ... }); And on the routeChange event: myApp

Line chart not hitting the right value on chart and has a smooth line

醉酒当歌 提交于 2019-12-20 04:19:53
问题 Below is my line graph where I am using 2 lines to show different values, One line is blue and the other is red. I want the line to have sharp points. and i would like the line it sit on the right vaule that i have gievn. for example if '28 dec' is value '4' and '29 dec' is value '2' and '30 dec' is value '5', Right now the values are not exactly hitting the number for example on 'Dec 25' the value is 3 but on the chart the line is going under 3 and it looks like 2.5. is this because the line

nvd3 Bubble chart with log scale

北城余情 提交于 2019-12-20 02:46:13
问题 I am using NVD3 scatter/ Bubble chart. This is a continuation from the question here. I am plotting the log base 2 values for the y axis. But I want the y axis to have the original values as labels corresponding to the log base 2 scale. I am unable to understand how to do so. Edit This is what I have for plotting data[i].values.push({ x: random() , y: log2(yValue) , size: Math.random() }); function log2(val) { console.log("val = " + val + " : " + Math.log(val) / Math.LN2) return Math.log(val)

NVD3.js: ReferenceError: nv is not defined

☆樱花仙子☆ 提交于 2019-12-19 18:56:07
问题 I am using NVD3.js library to generate graph. I tried adding line chart into it & getting the above error. How to resolve it? I am trying this here 回答1: Can you post a Plunker/Fiddle? Off the top of my head, it may just be where you're including the nv.d3.js. Did you also include D3.js? 回答2: Actually i found out, the problem was the folder structure. The examples that comes with the angular-nvd3 website gives path bower_components/nvd3/nv.d3.js , check in your bower_components file the actual

ScatterChart in NVD3 – Reading the data from csv file

假如想象 提交于 2019-12-19 11:34:40
问题 I am trying to read in data from csv file and want to visualise this data with a scatterChart in NVD3. I would have linked to a JSfiddle or something similar but I don't know how to include a csv file in these online JavaScript IDEs. Is that possible? The csv file has the following format: country,y,x Algeria,91.8,15.7 Bahrain,98.2,49.3 Jordan,99.1,55.0 Kuwait,98.6,57.4 Lebanon,98.7,58.6 My best guess for the code to read the csv file with is: var scatterdata = [ { key : "Group1", values : []

How to remove NVD3 chart resize/update delay

杀马特。学长 韩版系。学妹 提交于 2019-12-19 10:22:18
问题 I've created an NVD3 multiBarChart and placed it in a jQuery resizable container. When resizing the chart, each render incurs the same delay as when the chart is first drawn: staggered left-to-right delayed drawing of the bars. This looks cool when the chart is first drawn, but it's a nuisance when resizing the chart. I've experimented with nv.d3.css, reducing every delay to 0ms to no avail. Haven't yet inspected the NVD3 JS and am hoping not to need to. Fiddle: http://jsfiddle.net/a5Fnj/10/