';
- if (isCircular) {
- const label = (w.globals.labels && w.globals.labels[seriesIndex]) || '';
- const value = series[seriesIndex];
- const color = w.config.colors[seriesIndex];
- html += '
' +
- '
' +
- '' +
- '' + label + '' +
- '' + value + '' +
- '
';
- } else {
- const title = xLabelAt(dataPointIndex);
- if (title) {
- html += '
' + title + '
';
- }
- html += '
';
- (w.globals.initialSeries || []).forEach((s, idx) => {
- const color = w.config.colors[idx];
- const name = (s && s.name) || '';
- const value = series[idx] && series[idx][dataPointIndex] !== undefined
- ? series[idx][dataPointIndex]
- : '-';
- html += '
' +
- '' +
- '' + name + '' +
- '' + value + '' +
- '
';
- });
- html += '
';
- }
- html += '
';
- return html;
- }"
- },
-
- Title = new ApexCharts.Title
- {
- Style = new ApexCharts.TitleStyle
- {
- FontSize = "14px",
- FontWeight = "600"
- }
- },
-
- Subtitle = new ApexCharts.Subtitle
- {
- Style = new ApexCharts.SubtitleStyle { FontSize = "12px" }
- },
-
- PlotOptions = new ApexCharts.PlotOptions
- {
- Bar = new ApexCharts.PlotOptionsBar
- {
- BorderRadius = 4,
- ColumnWidth = "55%",
- BorderRadiusApplication = ApexCharts.BorderRadiusApplication.End
- },
- Pie = new ApexCharts.PlotOptionsPie
- {
- ExpandOnClick = true,
- DataLabels = new ApexCharts.PieDataLabels
- {
- MinAngleToShowLabel = 360 // labels off; the tooltip shows values
- },
- Donut = new ApexCharts.PlotOptionsDonut
- {
- Size = "70%",
- Background = "transparent"
- }
- },
- Radar = new ApexCharts.PlotOptionsRadar
- {
- Polygons = new ApexCharts.RadarPolygons
- {
- StrokeColors = "var(--border)",
- ConnectorColors = "var(--border)"
- }
- },
- RadialBar = new ApexCharts.PlotOptionsRadialBar
- {
- Hollow = new ApexCharts.Hollow
- {
- Size = "60%"
- },
- Track = new ApexCharts.Track
- {
- Background = "var(--muted)"
- },
- DataLabels = new ApexCharts.RadialBarDataLabels
- {
- Name = new ApexCharts.RadialBarDataLabelsName { Show = true, FontSize = "13px" },
- Value = new ApexCharts.RadialBarDataLabelsValue { Show = true, FontSize = "22px", FontWeight = "600" }
- }
- }
- }
- };
- }
+ private static string Variables(params string[] colors) =>
+ string.Concat(colors.Select((color, i) => $"--chart-{i + 1}:{color};"));
+}
- // ApexCharts color arrays can't use CSS variables.
- private static List