Skip to content

Commit

Permalink
Merge pull request #35 from nzzdev/release-1.3.0
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
benib authored Oct 30, 2017
2 parents 3247a17 + eadb79a commit 8972dc2
Show file tree
Hide file tree
Showing 10 changed files with 348 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.1
8.8
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
- docker
language: node_js
node_js:
- '8.1'
- '8.8'
install:
- npm install -g jspm
- npm install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use following version of Node as the base image
FROM node:8.1
FROM node:8.8

# Set work directory for run/cmd
WORKDIR /app
Expand Down
36 changes: 9 additions & 27 deletions chart/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,38 +277,20 @@ export function getDivisorString(divisor) {
}

function getContextHtml(item, chartistConfig) {
let axisExplanation = {x: '', y: ''};
axisExplanation.y = getDivisorString(chartistConfig.yValueDivisor);

const labels = {
x: item.xAxisLabel,
y: item.yAxisLabel
}

let html = getLegendHtml(item);
var axisNames = new Array('y', 'x');
if (chartistConfig.horizontalBars) {
axisNames.reverse();
}

html += `<div class="q-chart__label-y-axis s-font-note-s s-font-note-s--light">${labels[axisNames[0]] || ''}${axisExplanation[axisNames[0]]}</div>`;

if (item.data.x && item.dataSeriesType && item.dataSeriesType.id === 'date') {
if (chartistConfig.horizontalBars) {
html += `<div class="q-chart__label-x-axis s-font-note-s s-font-note-s--light">${labels[axisNames[1]] || ''}${axisExplanation[axisNames[1]]}</div>`;
let chartistContainerMarkup = '<div class="q-chart__chartist-container"></div>';

if (chartistConfig.horizontalBars) {
if (!item.options.hideAxisLabel) {
html += `<div class="q-chart__label-y-axis s-font-note-s s-font-note-s--light">${item.xAxisLabel || ''}</div>`;
}
html += '<div class="q-chart__chartist-container"></div>';
html += chartistContainerMarkup;
} else {
if (chartistConfig.horizontalBars) {
html += `
<div class="q-chart__label-x-axis s-font-note-s s-font-note-s--light">${labels[axisNames[1]] || ''}${axisExplanation[axisNames[1]]}</div>
<div class="q-chart__chartist-container"></div>
`;
} else {
html += `
<div class="q-chart__chartist-container"></div>
<div class="q-chart__label-x-axis s-font-note-s s-font-note-s--light">${labels[axisNames[1]] || ''}${axisExplanation[axisNames[1]]}</div>
`;
html += chartistContainerMarkup;
if (!item.options.hideAxisLabel) {
html += `<div class="q-chart__label-x-axis s-font-note-s s-font-note-s--light">${item.xAxisLabel || ''}</div>`;
}
}
html += '</div>';
Expand Down
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<html>
<head>
<meta charset="utf-8">
<title>Q Renderer Skeleton</title>
<title>Q Chart</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://context-service.st.nzz.ch/stylesheet/all/nzz.ch.css">
<link rel="stylesheet" href="https://service.sophie.nzz.ch/bundle/sophie-q@^1,sophie-font@^1,sophie-color@^1,sophie-viz-color@^1[general].css">
<script src="https://rawgit.com/filamentgroup/loadCSS/master/src/loadCSS.js"></script>
</head>
Expand Down Expand Up @@ -494,6 +495,7 @@
"prognosisStart": null
},
"highlightDataSeries": 1,
"hideAxisLabel": false,
"colorOverwrite": [
{
"color": "red",
Expand Down
Loading

0 comments on commit 8972dc2

Please sign in to comment.