Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped or Stacked bar chart with sensor bars #1470

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dc",
"version": "3.0.6",
"version": "3.0.6-grouped-or-stacked",
"license": "Apache-2.0",
"copyright": "2017",
"description": "A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js ",
Expand Down
225 changes: 135 additions & 90 deletions spec/bar-chart-spec.js
100644 → 100755

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions spec/composite-chart-spec.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ describe('dc.compositeChart', function () {
});

it('should generate sub bar charts', function () {
expect(chart.selectAll('g.sub g._0 rect').size()).toBe(6);
expect(chart.selectAll('g.sub g.bar-group rect.bar').size()).toBe(6);
});

it('should render sub bar chart', function () {
expect(chart.selectAll('g.sub rect.bar').size()).not.toBe(0);
chart.selectAll('g.sub rect.bar').each(function (d, i) {
chart.selectAll('g.sub g.bar-group rect.bar').each(function (d, i) {
switch (i) {
case 0:
expect(d3.select(this).attr('x')).toBeCloseTo('22.637931034482758', 3);
expect(d3.select(this).attr('x')).toBeCloseTo('22.224137931034484', 3);
expect(d3.select(this).attr('y')).toBe('93');
expect(d3.select(this).attr('width')).toBe('3');
expect(d3.select(this).attr('height')).toBe('17');
break;
case 5:
expect(d3.select(this).attr('x')).toBeCloseTo('394.3620689655172', 3);
expect(d3.select(this).attr('x')).toBeCloseTo('393.94827586206895', 3);
expect(d3.select(this).attr('y')).toBe('80');
expect(d3.select(this).attr('width')).toBe('3');
expect(d3.select(this).attr('height')).toBe('30');
Expand Down Expand Up @@ -409,7 +409,7 @@ describe('dc.compositeChart', function () {
});

it('should trigger the sub-chart renderlet', function () {
expect(d3.select(chart.selectAll('rect').nodes()[0]).attr('width')).toBe('10');
expect(d3.select(chart.selectAll('rect.bar').nodes()[0]).attr('width')).toBe('10');
});
});

Expand Down
Loading