Skip to content

Commit

Permalink
Merge pull request #254 from Esri/newSpecLabels
Browse files Browse the repository at this point in the history
New spec labels
  • Loading branch information
benstoltz authored Mar 1, 2017
2 parents 1ac73a0 + a06bbd9 commit 4eb5327
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion site/source/partials/example-bar-url.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
];
chart.tooltip = {
"title": "{Type}",
"content": "{Number_of_SUM} Students in {Type}"
Expand Down
14 changes: 10 additions & 4 deletions src/cedar.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,20 @@ export default class Cedar {
}

try {
if (this._definition.datasets && this._definition.series) {
this._definition.dataset = specUtils.convertDatasetsToDataset(this._definition.datasets, this._definition.series, this._chartType, this._definition.dataset);
if (!this._definition.tooltip) {
this.tooltip = {
'title': `{${this._definition.series[0].category.field}}`,
'content': `{${this._definition.series[0].value.field}}`
};
}
}

// Creates the HTML Div and styling if not already created
if (this._definition.tooltip) {
this._createTooltip(this._definition.tooltip.id);
}

if (this._definition.datasets && this._definition.series) {
this._definition.dataset = specUtils.convertDatasetsToDataset(this._definition.datasets, this._definition.series, this._chartType, this._definition.dataset);
}
// Ensure we have required inputs or defaults
let compiledMappings = specUtils.applyDefaultsToMappings(this._definition.dataset.mappings, this._definition.specification.inputs);

Expand Down

0 comments on commit 4eb5327

Please sign in to comment.