Skip to content

Commit

Permalink
Merge pull request #232 from nzzdev/release-3.6.8
Browse files Browse the repository at this point in the history
Release 3.6.8 - Additions to line chart highlights
  • Loading branch information
KiaraEdTech authored Aug 5, 2021
2 parents e134a74 + ce4c702 commit 436abe2
Show file tree
Hide file tree
Showing 6 changed files with 5,135 additions and 17 deletions.
49 changes: 47 additions & 2 deletions chartTypes/line/vega-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,54 @@
"scale": "yScale",
"field": "yValue"
},
"strokeWidth": {
"value": 2
"strokeWidth": [
{
"test": "datum.isHighlighted === true",
"value": 5
}
],
"defined": {
"signal": "datum.yValue !== null"
},
"strokeJoin": {
"value": "round"
},
"stroke": [
{
"test": "datum.isHighlighted === true",
"value": "white"
}
],
"interpolate": {
"value": "linear"
}
}
}
},
{
"type": "line",
"from": {
"data": "series"
},
"encode": {
"enter": {
"x": {
"scale": "xScale",
"field": "xValue"
},
"y": {
"scale": "yScale",
"field": "yValue"
},
"strokeWidth": [
{
"test": "datum.isHighlighted === true",
"value": 3
},
{
"value": 2
}
],
"defined": {
"signal": "datum.yValue !== null"
},
Expand Down
6 changes: 4 additions & 2 deletions helpers/legend/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ async function getLegendModel(item, toolRuntimeConfig, chartType, server) {
color = toolRuntimeConfig.colorSchemes.grays[8];
}
}

return {
label: label,
color: color,
iconType: legendType
iconType: legendType,
isHighlighted: optionsHelpers.hasSeriesHighlight(item) &&
item.options.highlightDataSeries.includes(index)
};
});
legendModel.legendItems = legendModel.legendItems.concat(dataSeries);
Expand Down
Loading

0 comments on commit 436abe2

Please sign in to comment.