File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/lib/components/data-vis/line-chart Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 127
127
128
128
basicLineParams = {},
129
129
colorLineParams = (tier , line , lineIndex ) => {
130
- const colorValues = Object .values (colors);
131
- return { pathStrokeColor: colorValues[lineIndex % colorValues .length ] };
130
+ return { pathStrokeColor: lineColorMap .get (line .areaCode ) };
132
131
},
133
132
} = $props ();
134
133
152
151
slatePurple: " #64587C" ,
153
152
});
154
153
154
+ const lineColorMap = new Map ();
155
+
156
+ lineChartData .lines .forEach ((line , index ) => {
157
+ const colorValues = Object .values (colors);
158
+ const color = colorValues[index % colorValues .length ];
159
+ lineColorMap .set (line .areaCode , color);
160
+ });
161
+
155
162
let defaultLineParams = $derived ({
156
163
xFunction,
157
164
yFunction,
You can’t perform that action at this time.
0 commit comments