From 97e628c4e1744709609cc842155708d23b8722e2 Mon Sep 17 00:00:00 2001 From: Malar Kannan Date: Mon, 2 Jul 2018 00:06:04 +0530 Subject: [PATCH] added plot titles to config --- public/config.json | 3 +++ src/Chart.tsx | 2 +- src/ChartLoader.tsx | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/config.json b/public/config.json index bb5f035..3b56da2 100644 --- a/public/config.json +++ b/public/config.json @@ -22,6 +22,7 @@ } ], "chartList": [{ + "chartTitle": "Status Plot", "fileName": "data.csv", "chartColumn": "status" }, @@ -29,9 +30,11 @@ "fileName": "data.csv", "chartColumn": "age" }, { + "chartTitle": "Another Status Plot", "fileName": "data.csv", "chartColumn": "status" }, { + "chartTitle": "Yet Another Status Plot", "fileName": "data.csv", "chartColumn": "status" }, { diff --git a/src/Chart.tsx b/src/Chart.tsx index 948daec..4ff21bf 100644 --- a/src/Chart.tsx +++ b/src/Chart.tsx @@ -56,7 +56,7 @@ export class Chart extends React.Component { - {_.capitalize(this.props.chartColumn)} + {this.props.title} diff --git a/src/ChartLoader.tsx b/src/ChartLoader.tsx index 912f33c..ebff8f4 100644 --- a/src/ChartLoader.tsx +++ b/src/ChartLoader.tsx @@ -11,7 +11,10 @@ export default class ChartLoader extends React.Component { const colorMap = colorMaps[o.chartColumn]; return ( - + ); })}