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

Added "Multi Chart" that allows mix-and-match of different series types #586

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Allow changing series type when only one aggregate
  • Loading branch information
andy-lee-eng committed May 27, 2019
commit 63aa22e13bfe8281cd76fccc21a3594b5a8eba5e
34 changes: 17 additions & 17 deletions packages/perspective-viewer-d3fc/src/js/axis/axisSplitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ export const axisSplitter = (settings, sourceData, splitFn = dataSplitFunction)

// Renderer to show the special controls for moving between axes
const splitter = selection => {
if (settings["mainValues"].length === 1) return;

const labelsInfo = settings["mainValues"].map((v, i) => ({
index: i,
name: v.name
}));
const mainLabels = labelsInfo.filter(v => !splitter.isOnAltAxis(v.name));
const altLabels = labelsInfo.filter(v => splitter.isOnAltAxis(v.name));

const labeller = () => splitterLabels(settings).color(color);

selection.select(".y-label-container>.y-label").call(labeller().labels(mainLabels));
selection.select(".y2-label-container>.y-label").call(
labeller()
.labels(altLabels)
.alt(true)
);
if (settings["mainValues"].length !== 1) {
const labelsInfo = settings["mainValues"].map((v, i) => ({
index: i,
name: v.name
}));
const mainLabels = labelsInfo.filter(v => !splitter.isOnAltAxis(v.name));
const altLabels = labelsInfo.filter(v => splitter.isOnAltAxis(v.name));

const labeller = () => splitterLabels(settings).color(color);

selection.select(".y-label-container>.y-label").call(labeller().labels(mainLabels));
selection.select(".y2-label-container>.y-label").call(
labeller()
.labels(altLabels)
.alt(true)
);
}

decorate(selection.select(".y-label-container"), 0);
decorate(selection.select(".y2-label-container"), 1);
Expand Down