File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ function App() {
4040 legend = { 'bottom' }
4141 tooltipVisible = { true }
4242 />
43- { /* <AreaChart
43+ < AreaChart
4444 theme = "dark"
4545 height = "100%"
4646 width = "100%"
@@ -52,7 +52,7 @@ function App() {
5252 yGrid = { true }
5353 xAxisLabel = "Date"
5454 yAxisLabel = "Value"
55- /> */ }
55+ />
5656 < LineChart
5757 theme = "light"
5858 height = { '100%' }
Original file line number Diff line number Diff line change @@ -185,10 +185,13 @@ export default function AreaChart({
185185 // Define how the data will drive your design
186186 // ********************
187187
188+ const numberOfKeys = Array . from ( keys ) . length ;
188189 const discreteColors =
189- Array . from ( keys ) . length < 4 ? 3 : Math . min ( Array . from ( keys ) . length , 9 ) ;
190- const computedScheme = d3 [ `${ colorScheme } ` ] [ discreteColors ] ;
191- const colorScale = d3 . scaleOrdinal ( Array . from ( computedScheme ) . reverse ( ) ) ;
190+ numberOfKeys < 4 ? 3 : Math . min ( Array . from ( keys ) . length , 9 ) ;
191+ const computedScheme = Array . from (
192+ d3 [ `${ colorScheme } ` ] [ discreteColors ]
193+ ) . reverse ( ) ;
194+ const colorScale = d3 . scaleOrdinal ( computedScheme ) ;
192195 colorScale . domain ( keys ) ;
193196
194197 // ********************
You can’t perform that action at this time.
0 commit comments