score:0
Dimple's documentation on pie charts isn't very good. From what I can puzzle out from there examples, pie charts are treated somewhat differently.
- The require a measured axis of position "p".
- They require a
categoryField
when adding the series.
So fixing your example code, it becomes:
var svg = dimple.newSvg("#chartContainer", 590, 400);
var array1 = [10, 20, 30, 40, 50];
var array2 = [600, 300, 400, 200, 100];
var data = new Array();
for (var i = 0; i < array1.length; ++i) {
data.push({
x: array2[i],
y: array1[i]
});
}
var myChart = new dimple.chart(svg, data);
myChart.setBounds(60, 30, 510, 305)
//var x = myChart.addCategoryAxis("x", "x");
//myChart.addMeasureAxis("y", "y");
myChart.addMeasureAxis("p", "x");
myChart.addSeries("y", dimple.plot.pie);
myChart.draw();
Example here.
Source: stackoverflow.com
Related Query
- d3.js Error : Invalid value for <g> attribute transform="translate(NaN,5)"
- D3 Directive- gettng error for invalid value for path
- C3 timeseries chart giving error Invalid value for <path> attribute
- Invalid value for <path> attribute
- Error: Invalid value for <rect> attribute width="NaN"
- Invalid value for <circle> attribute cx=“NaN” using D3.js
- Error: Invalid value for <g> attribute transform="translate(undefined,undefined)"
- Invalid value for <circle> attribute cx="NaN" using NVD3.js
- d3.js:5942 Error: Invalid value for <g> attribute transform="translate(NaN,0)"
- d3.js throwing Error: Invalid value for <g> attribute transform="null" on transition()
- D3 Integration with Angular: "Error: Invalid value for <rect> attribute x"
- D3.js Error: Invalid value for <path> attribute for a line chart
- Bar Chart D3.js Error: Invalid value for <rect> attribute
- How to handle `Error: invalid value for <path> attribute d="waaa"` in d3.js?
- D3 Pie Error: Invalid value for <text> attribute transform="translate(NaN,NaN)"
- d3.js arc.centroid(d) : Error: Invalid value for <text> attribute transform="translate(NaN,NaN)"
- C3js and D3js Error: Invalid value for <g> attribute transform="translate(0,NaN)"
- Invalid value for <circle> attribute r="NaN" in D3 scatterplot code
- Error: Invalid value for <path> attribute -- During a d3 Projection Transition -- Infinity & NaN
- Error: Invalid value for <rect> attribute width="NaN" 6d3.v3.min.js:1 Error: Invalid value for <text> attribute x="NaN"
- Error: Invalid value for <circle> attribute cx="NaN" in dimple.js
- Invalid value for <path> attribute using existing objects
- D3.js Line Chart Error: Invalid value for <path> attribute d="MNaN,NaNLNaN
- Error: Invalid value for <path> attribute d=".. for pie chart
- How can I solve Error: Invalid value for <text> attribute transform="translate(NaN,NaN)" on arc.centroid(d)?
- Error: Invalid value for <text> attribute x="NaN" in angularJS nvd3-multi-bar-chart
- Error: Invalid value for <path> attribute d="MNaN,NaNA5,5 0 1,1 NaN,NaNL0,0Z"
- D3: Day names on x-axis: Invalid value for <text> attribute x="NaN"
- D3.js "Error: Invalid value for <path> attribute" for moving average
- Parsing and invalid value for D3.js sankey
More Query from same tag
- d3.js 'mousewheel' event is NOT working on Firefox (it works only in Chrome, Safari and IE browsers)
- Editing breadcrumb trail text in d3js Sunburst Example
- D3 Dragging on SVG "Path" Element Breaks when d.x is defined, hidden datum?
- d3.js & nvd3.js -- How to set y-axis range
- How to add controls and buttons to map?
- Dual Y axis line chart in d3.js without external data
- Bounds for networks and forces with D3.js?
- Zoom a node in and out using D3 Javascript
- d3.js mouseover event not triggered when mouse is touching another element too
- d3 keeping text from extending outside of SVG
- How to select multiple selectors with selectAll?
- SimpleHTTPServer Error 404 - "GET /d3/d3.v3.js HTTP/1.1" 404
- svg to image on demand
- convert arrays to json
- Accented Characters don't display properly
- d3.js iterate order changes
- How can I draw pie chart with custom color in d3.js
- D3 add link with delay
- Gettin crossfilter.js error "too much recursion"
- Bouncing effect in d3
- Updating a pie chart with a new data set with more values
- Missing Rect Objects in D3 Bar Chart
- Insert scopedSlot into d3 svg using foreignObject
- Transition.each in d3 doesn't interpolate attributes
- Adding 'rect' elements to blank svg canvas in d3 is failing on .data()
- Customized chart using d3 in react native
- Append multiple data arrays to data points
- in d3.js how do you add and remove multiple lines on different click events?
- D3 Collapsable Tree - Collapse one level at a time
- Using d3-tip with require js modules