Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Scatter Plot in Composite Chart produces invalid translate values #870

Open
@LorenzGardner

Description

@LorenzGardner

Using 2.0 Beta 5

Error: Invalid value for attribute transform="translate(NaN,NaN)"
d3.min.js:1 o
d3.min.js:3 (anonymous function)
d3.min.js:1 Y
d3.min.js:3 _a.each
d3.min.js:3 _a.attr
dc.js:7447 dc.scatterPlot._chart.plotData
dc.js:5850 dc.compositeChart._chart.plotData
dc.js:2938 drawChart
dc.js:2914 dc.coordinateGridMixin._chart._doRender
dc.js:1101 dc.baseMixin._chart.render
dc.js:172 dc.renderAll

my scatter plot def:

dc.scatterPlot(theChart)
.group(tempGroup, "Temp (°C)")
.ordinalColors([tempColor]);

My chart def

var theChart = dc.compositeChart("#theChart")
theChart
.width(1180)
.height(420)
.dimension(timeDim)
.x(d3.time.scale().domain([startTime, endTime]))
.y(d3.scale.linear().domain([0,1]))
.xUnits(d3.time.second)
.brushOn(false)
.margins({top: 10, right: chartRightMargin, bottom: 30, left: chartLeftMargin})
.compose([lineA, lineB, tempLine, lineD])
.legend(dc.legend().x(1100).y(10))
.mouseZoomable(false)
.renderHorizontalGridLines(true)
.renderVerticalGridLines(true)
.xAxis();

The _locator function access coordinateGridMixin keyAccessor() an valueAccessor() to get the x and y translate, those appear to be coming back NaN. Is this coordinateGridMixin not valid for a scatter plot?

Possibly related to #702

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions