(title, yAxisTitle, yAxisOptions = {}, thresholds = null)
| 182 | } |
| 183 | |
| 184 | function getBaseChartConfig(title, yAxisTitle, yAxisOptions = {}, thresholds = null) { |
| 185 | const fontSizes = { |
| 186 | title: "18px", |
| 187 | subtitle: "16px", |
| 188 | axis: "14px", |
| 189 | legend: "14px", |
| 190 | tooltip: "14px", |
| 191 | }; |
| 192 | |
| 193 | const config = { |
| 194 | chart: { |
| 195 | type: "line", |
| 196 | height: 460, |
| 197 | zoom: { enabled: true, type: "x" }, |
| 198 | toolbar: { show: true }, |
| 199 | ...getChartOptions(), |
| 200 | }, |
| 201 | dataLabels: { enabled: false }, |
| 202 | stroke: { curve: "straight", width: 2 }, |
| 203 | title: { |
| 204 | text: title, |
| 205 | align: "left", |
| 206 | style: { |
| 207 | fontSize: fontSizes.title, |
| 208 | }, |
| 209 | }, |
| 210 | grid: { |
| 211 | borderColor: getGridBorderColor(), |
| 212 | }, |
| 213 | xaxis: { |
| 214 | type: "datetime", |
| 215 | title: { |
| 216 | text: "Date", |
| 217 | style: { fontSize: fontSizes.axis }, |
| 218 | }, |
| 219 | labels: { |
| 220 | datetimeUTC: false, |
| 221 | style: { fontSize: "12px" }, |
| 222 | }, |
| 223 | tooltip: { enabled: false }, |
| 224 | }, |
| 225 | yaxis: { |
| 226 | title: { |
| 227 | text: yAxisTitle, |
| 228 | style: { fontSize: fontSizes.axis }, |
| 229 | }, |
| 230 | labels: { |
| 231 | style: { fontSize: fontSizes.axis }, |
| 232 | }, |
| 233 | ...yAxisOptions, |
| 234 | }, |
| 235 | legend: { |
| 236 | position: "bottom", |
| 237 | offsetY: 0, |
| 238 | height: 80, |
| 239 | fontSize: fontSizes.legend, |
| 240 | }, |
| 241 | tooltip: { |
no test coverage detected