Skip to content

MudTimeSeriesChart: Use InvariantCulture when rendering opacity (#11696)#11697

Merged
ScarletKuro merged 1 commit intoMudBlazor:devfrom
svarnyjunak:fix/time-series-opacity
Jul 23, 2025
Merged

MudTimeSeriesChart: Use InvariantCulture when rendering opacity (#11696)#11697
ScarletKuro merged 1 commit intoMudBlazor:devfrom
svarnyjunak:fix/time-series-opacity

Conversation

@svarnyjunak
Copy link
Contributor

Fixes #11696

When rendering a MudTimeSeriesChart with FillOpacity on TimeSeriesChartSeries set to a decimal value, the opacity is not applied correctly in some environments.

All decimal values must be formatted using the Invariant Culture.

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the style of this project.
  • I've added relevant tests or tested on existing ones.

@sonarqubecloud
Copy link

@versile2 versile2 requested a review from Copilot July 23, 2025 14:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes opacity rendering issues in MudTimeSeriesChart where decimal values for FillOpacity and StrokeOpacity were not being correctly applied in certain environments due to culture-specific decimal formatting.

  • Updates opacity value rendering to use InvariantCulture formatting
  • Ensures consistent decimal formatting across different localization environments

Comment on lines +65 to +70
<path class="@lineClass" @onclick="() => SelectedIndex = chartLine.Index" fill="none" stroke="@color" stroke-opacity="@series.StrokeOpacity.ToString(CultureInfo.InvariantCulture)" stroke-width="@MudChartParent?.ChartOptions.LineStrokeWidth" d="@chartLine.Data"></path>

if (series.LineDisplayType == LineDisplayType.Area)
{
var chartArea = _chartAreas[chartLine.Index];
<path class="@lineClass" @onclick="() => SelectedIndex = chartLine.Index" fill="@color" fill-opacity="@series.FillOpacity" d="@chartArea.Data"></path>
<path class="@lineClass" @onclick="() => SelectedIndex = chartLine.Index" fill="@color" fill-opacity="@series.FillOpacity.ToString(CultureInfo.InvariantCulture)" d="@chartArea.Data"></path>
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the opacity formatting logic into a helper method or property to avoid code duplication. Both StrokeOpacity and FillOpacity use the same ToString(CultureInfo.InvariantCulture) pattern.

Copilot uses AI. Check for mistakes.
@ScarletKuro ScarletKuro merged commit b24a6cc into MudBlazor:dev Jul 23, 2025
7 checks passed
@svarnyjunak svarnyjunak deleted the fix/time-series-opacity branch July 24, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudTimeSeriesChart renders wrong FillOpacity

3 participants